String Formatting
Cloud Document Maker provides a set of Jinja helper functions for formatting strings directly in your templates. These helpers are useful for transforming text, handling line breaks, and ensuring consistent formatting.
Available Helpers
Uppercase
Converts text to uppercase.
{{ Uppercase(my_string) }}Example: "Hello World" → "HELLO WORLD"
Lowercase
Converts text to lowercase.
{{ Lowercase(my_string) }}Example: "Hello World" → "hello world"
LinesToCommas
Splits text by line breaks, trims whitespace from each line, removes blank lines, and joins with commas.
{{ LinesToCommas(address) }}Example:
Line 1Line 2Line 3→ "Line 1, Line 2, Line 3"
CommasToLines
Splits text by commas, trims whitespace, removes empty values, and joins with line breaks.
{{ CommasToLines(items) }}Example: "Item 1, Item 2, Item 3" →
Item 1Item 2Item 3RemoveLineBreaks
Removes all line breaks from text without inserting spaces.
{{ RemoveLineBreaks(text) }}Example: "Line 1\nLine 2" → "Line 1Line 2"
RemoveBlankLines
Removes empty lines and collapses multiple blank lines, while preserving meaningful line breaks.
{{ RemoveBlankLines(text) }}Example:
Line 1
Line 2→
Line 1Line 2