Template Attribute Reference
Merge Field Attributes
format-number
Purpose: Format numeric values with thousands separators and decimal places
Syntax: {{!Object.NumericField format-number="pattern"}}
Supported Patterns:
#,###.##
US/UK currency format
4222300.8
4,222,300.80
#,###
Whole numbers with commas
4222300.8
4,222,301
#.###
European format (period separator)
4222300.8
4.222.301
#.###,##
European format with decimals
4222300.8
4.222.300,80
Examples:
{{!Opportunity.Amount format-number="#,###.##"}}
${{!Opportunity.Amount format-number="#,###.##"}}
€{{!Opportunity.Amount format-number="#.###,##"}}Notes:
Patterns work with numbers of any size beyond the 4 digits shown
Rounding is applied when precision exceeds the format specification
Currency symbols must be added separately (outside the merge field)
Works with standard numeric, currency, and formula field types
format-date
Purpose: Format Salesforce date and datetime fields using Java SimpleDateFormat patterns
Syntax: {{!Object.DateField format-date="pattern"}}
Common Patterns:
MM/dd/yyyy
US short format
04/04/2017
dd/MM/yyyy
European short format
04/04/2017
dd.MM.yyyy
European dot format
04.04.2017
MMMM dd, yyyy
Long format
October 28, 2018
EEEE, MMMM dd, yyyy
Full format
Monday, October 28, 2018
MMMM
Month name only
October
yyyy
Year only
2018
MMM dd
Short month and day
Oct 28
Pattern Components:
yyyy
4-digit year
2024
yy
2-digit year
24
MMMM
Full month name
January
MMM
Abbreviated month
Jan
MM
Month as number (01-12)
01
M
Month as number (1-12)
1
dd
Day of month (01-31)
05
d
Day of month (1-31)
5
EEEE
Full day name
Monday
EEE
Abbreviated day
Mon
HH
Hour (00-23)
14
hh
Hour (01-12)
02
mm
Minutes (00-59)
30
ss
Seconds (00-59)
45
a
AM/PM marker
PM
Timezone Support:
Common Timezones:
America/New_YorkAmerica/ChicagoAmerica/DenverAmerica/Los_AngelesEurope/LondonEurope/ParisAsia/TokyoAustralia/Sydney
Examples:
Notes:
Patterns are case sensitive (MM=month, mm=minutes)
Times are stored in GMT and must be converted using TZ parameter
Only Salesforce-supported timezones are accepted
Month and day names are always in English
Use Salesforce formula fields for non-English date formatting
checkbox
Purpose: Display boolean fields as checkbox or radio button images
Syntax: {{!Object.BooleanField checkbox="style"}}
Supported Styles:
true
Standard checkbox
Dotted white border, black checkmark when checked
black
Filled checkbox
Solid black border, black fill with white checkmark when checked
radio
Radio button
Circle, filled when checked
Examples:
Custom Styling:
Notes:
Displays the current state of the boolean field on the record
Not supported in DOCX file format (PDF only)
Checkbox images have the CSS class
sdcheckboxChecked state shows filled/marked, unchecked shows empty
MICR
Purpose: Output text in MICR E-13B font for check printing and bank processing
Syntax:
Parameters:
fontSize (required): Controls character width (recommended: 11)
spacing (optional): Controls space between characters (default: 0)
Examples:
MICR Special Characters:
t
⑆
Transit (routing)
o
⑈
On-us (account)
a
⑉
Amount
d
⑊
Dash
Notes:
Outputs series of images suitable for PDF check generation
Only digits (0-9) and characters
t,o,a,dare transformedOther characters are ignored
Higher fontSize values create larger characters
Negative spacing values bring characters closer together
Requires magnetic ink toner for actual bank processing
Standard check printing uses fontSize="11" with spacing="0"
CR (Character Recognition)
Purpose: Output text in OCR-A or OCR-B fonts for machine-readable documents
Syntax:
Parameters:
fontType (required):
OCR-AorOCR-BfontSize (required): Character size (recommended: 20)
spacing (optional): Space between characters (default: 0)
Examples:
Notes:
Outputs series of images for PDF generation
Only digits 0-9 are transformed
Other characters are ignored
Spacing defaults to 0; negative values allowed
Lower spacing values bring characters closer together
Useful for checks and computer-readable forms
Does not require special toner for printing
ToUpperCase
Purpose: Transform text to all uppercase letters
Syntax: {{!Object.TextField ToUpperCase="true"}}
Examples:
Input/Output:
Common Use Cases:
Mailing labels
Legal document headers
Formal addresses
Standardized text sections
ToLowerCase
Purpose: Transform text to all lowercase letters
Syntax: {{!Object.TextField ToLowerCase="true"}}
Examples:
Input/Output:
Common Use Cases:
Email addresses
Website URLs
Standardizing case for technical fields
RTL (Right to Left)
Purpose: Reverse character strings for right-to-left languages (Hebrew, Arabic)
Syntax for Merge Fields:
Syntax for Template Sections:
Examples:
Input/Output:
Notes:
RTL attribute transforms merge field data only
<rtl>tags transform both merge fields and static textDo not combine RTL attribute with
<rtl>tags<rtl>tags don't work with text breaking across two linesUse separate
<rtl>tags for each line if text wrapsPrimarily used for PDF generation in RTL languages
translate
Purpose: Return translated picklist values using Salesforce Translation Workbench
Syntax: {{!Object.PicklistField translate="true"}}
Requirements:
Translation Workbench enabled in Salesforce
Picklist values translated in Translation Workbench
User language preferences set
Examples:
Input/Output (French locale):
SOQL Usage:
Notes:
Works only with picklist fields
Can also be used on field labels
Leverages Salesforce
toLabel()functionCauses errors if used on non-picklist field types
Respects user's language/locale settings
For related lists, use SOQL with
toLabel()
replaceAll
Purpose: Replace all occurrences of specified substrings
Syntax: {{!Object.Field replaceAll="find1,replace1,find2,replace2,..."}}
Examples:
Input/Output:
Notes:
Matches and replaces all occurrences of substrings
Different from
substitutewhich matches entire valuesCase sensitive matching
Can chain multiple replacements
No catch-all value
encrypt
Purpose: Display classically encrypted fields in decrypted form
Syntax: {{!Object.EncryptedField encrypt="true"}}
Examples:
Notes:
Works with Salesforce Classic Encryption
User must have permission to view encrypted data
Not supported for named query merge fields
Different from Platform Encryption
Display
Purpose: Render picklist field values as display labels instead of API names
Syntax: {{!Object.PicklistField Display="true"}}
Examples:
When to Use:
Picklist API name:
stage_prospectingDisplay label:
ProspectingWithout attribute: Shows
stage_prospectingWith attribute: Shows
Prospecting
Notes:
Most picklists have identical labels and API names
Only necessary when they differ
Common in managed packages or older orgs
msnl
Purpose: Replace semicolons in multi-select picklists with line breaks
Syntax: {{!Object.MultiSelectPicklistField msnl="true"}}
Examples:
Input/Output:
Notes:
Converts semicolon-separated values to new lines
Makes multi-select values more readable
Particularly useful for forms and reports
breakeverynchars
Purpose: Insert spaces at specified character intervals to enable line breaks
Syntax: {{!Object.Field breakeverynchars="number"}}
Examples:
Input/Output:
PDF-Upload Template Styling:
Add to Additional Style field to force text wrapping.
Notes:
Negative, zero, or blank values have no effect
Inserted spaces allow text to wrap naturally
Useful for long unbroken strings (URLs, codes, hashes)
toCells
Purpose: Split field value into individual letter cells in a table
Syntax: {{!Object.Field toCells="cellCount,cssClass"}}
Requirements:
Must be used within
<td>tagsPart of a table structure
Examples:
Input/Output:
With Custom Styling:
Notes:
Each character becomes a separate table cell
Specifying more cells than characters creates blank cells
CSS class applies to all generated cells
Useful for forms requiring individual character entry boxes
strip-html
Purpose: Remove all HTML tags from rich text fields
Syntax: {{!Object.RichTextField strip-html="true"}}
Examples:
Input/Output:
For Related Lists: Use type="text" column attribute instead:
Notes:
Removes all HTML markup
Leaves only plain text content
Alternative to
type="text"for merge fieldsUseful when HTML formatting would cause issues
justifyNewLines
Purpose: Prevent irregular spacing when merging justified multi-paragraph text
Syntax: {{!Object.LongTextField justifyNewlines="HTMLElement"}}
Examples:
Input:
Output:
Notes:
Only works with
style="text-align: justify"Cannot be used with Microsoft Word templates
Each paragraph becomes its own HTML element
Prevents justification from affecting line breaks
blobToString
Purpose: Convert HTML-based blob data to strings
Syntax: {{!Object.BlobField blobToString="true"}}
Examples:
Notes:
Blob content must be convertible to string or well-formed HTML
Also available as related list column attribute
Useful for merging file content into documents
Will fail if blob contains binary data
Rich Text Rendering
Purpose: Preserve HTML formatting in rich text fields
Syntax: {{{!Object.RichTextField}}}
Note the Triple Braces: Three { instead of two
Examples:
Preserved Formatting:
Bold, italic, underline
Font colors and sizes
Bullet and numbered lists
Hyperlinks
Tables
Paragraph spacing
Notes:
Use three curly braces:
{{{!Field}}}Images in rich text only supported in PDF and DOCX formats
Alternative: Use
type="rtf"column attribute in related listsHTML is rendered as-is without escaping
Related List Column Attributes
substitute
Purpose: Replace entire field values with alternative text based on matching
Syntax:
Basic Examples:
Translation Example:
Organized with Parentheses:
Notes:
Matches entire field value (not substrings)
Matching is case-insensitive
Whitespace is trimmed before matching
Replacement values are exact (preserve case)
Odd number of values: last value is catch-all
Use
true/falsefor checkbox/boolean fieldsFor null values, use
nullprefixinsteadNumeric values must match precision exactly
replaceall (column-level)
Purpose: Replace substrings within field values (not entire values)
Syntax:
Basic Examples:
Regex Examples:
Regex Syntax:
Start with
[regex](including brackets)Use standard regex patterns
Capture groups with
( )Reference with
$1,$2, etc.
Difference from Substitute:
Matches
Entire value
Substrings
Multiple matches
First match only
All matches
Catch-all
Yes
No
Regex support
No
Yes
Notes:
Replaces all occurrences of substring
No catch-all/"else" condition
Supports regular expressions
Useful for text cleanup and formatting
showcolumn
Purpose: Conditionally show or hide entire table columns
Syntax:
Basic Examples:
Multiple Conditions:
With Header Row:
Supported Operators:
==
Equals
{{!Field}} == 'Value'
!=
Not equals
{{!Field}} != 'Value'
>
Greater than
{{!Field}} > 100
<
Less than
{{!Field}} < 100
>=
Greater or equal
{{!Field}} >= 100
<=
Less or equal
{{!Field}} <= 100
|
OR
(cond1 | cond2)
&&
AND
(cond1 && cond2)
Notes:
Column is hidden when condition evaluates to false
Apply same condition to header using
<!--RENDER=...-->Wrap OR/AND conditions in parentheses
Conditions reference the parent object, not list records
type
Purpose: Control how field content renders in columns
Supported Values: rtf, text, checkbox, radio
Syntax:
RTF (Rich Text Format):
Preserves HTML markup and formatting
Shows bold, italic, links, lists
Text:
Strips all HTML tags
Shows only plain text
Checkbox:
Displays checkbox image instead of true/false
Checked: ☑
Unchecked: ☐
Not supported in DOCX format
Radio:
Displays radio button instead of true/false
Selected: ⦿
Unselected: ○
Not supported in DOCX format
Custom Checkbox Styling:
Notes:
type="checkbox"andtype="radio"work in PDF onlyCheckbox/radio images have CSS class
sdcheckboxUse
type="text"to strip HTML from rich text fieldsUse
type="rtf"to preserve formatting
header
Purpose: Specify custom column header text
Syntax:
Examples:
Notes:
Overrides default field name headers
Use for user-friendly column names
Accepts any text string
Can include special characters and spaces
format-number (column-level)
Purpose: Format numeric columns with thousands separators and decimals
Syntax:
Supported Patterns:
#,###
Thousands separator
123456
123,456
#,###.##
Thousands + decimals
123456
1,234.56
#.###
European thousands
123456
123.456
#.###,##
European with decimals
123456
1.234,56
Examples:
With Prefix:
Notes:
Works with all numeric field types
Applies to every row in the column
Combine with
prefix/postfixfor currency symbolsRounding occurs when precision exceeds format
format-date (column-level)
Purpose: Format date columns using Java patterns
Syntax:
Common Patterns:
MM/dd/yyyy
04/04/2017
dd/MM/yyyy
04/04/2017
MMMM dd, yyyy
October 28, 2018
MMMM
October
yyyy
2018
Examples:
Notes:
Follows same patterns as merge field
format-datePatterns are case-sensitive
Month/day names in English only
Extract month, day, or year individually
mergenext
Purpose: Merge a column cell with the cell immediately to its right
Syntax:
Examples:
Notes:
Combines current cell with next cell horizontally
Use
prefix/postfixfor spacing between merged contentNot supported with group-by functionality
Useful for combining related data points
colspan
Purpose: Make a column span multiple columns horizontally
Syntax:
Examples:
With Headers:
Notes:
colspan="1"has no effect (default)Works like HTML colspan attribute
Useful for section headers and grouping
Column spans specified number of columns total
newrow
Purpose: Create new table rows at specified intervals
Syntax:
Values:
true- New row for each recordnumber- New row after every N records
Examples:
Mailing Label Example:
Output:
Notes:
newrow="true"creates vertical layoutnewrow="3"creates 3-column gridUseful for labels, badges, cards
Affects table row structure
prefix
Purpose: Add text before each non-null column value
Syntax:
Examples:
Notes:
Only appears for non-null values
For null values, use
nullprefixFor all values regardless, use
allprefixCan include spaces and special characters
nullprefix
Purpose: Add text before null column values
Syntax:
Examples:
Notes:
Only appears for null values
For non-null values, use
prefixFor all values, use
allprefixUseful for providing defaults
postfix
Purpose: Add text after each non-null column value
Syntax:
Examples:
Notes:
Only appears for non-null values
For null values, use
nullpostfixFor all values, use
allpostfixUseful for units, separators, formatting
nullpostfix
Purpose: Add text after null column values
Syntax:
Examples:
allprefix
Purpose: Add text before all column values (null and non-null)
Syntax:
Examples:
Notes:
Replaces need for both
prefixandnullprefixwhen identicalAlways displays regardless of field value
Simpler than using two separate attributes
allpostfix
Purpose: Add text after all column values (null and non-null)
Syntax:
Examples:
Notes:
Replaces need for both
postfixandnullpostfixwhen identicalAlways displays regardless of field value
abfprefixouter
Purpose: Add text before all columns except the first one
Syntax:
Use Case: Creating comma-separated lists without leading comma
Examples:
Notes:
Prefix appears on all items except first
Prevents leading separator in lists
String appears outside of any
prefixattributeUse with
<class>none</class>for custom formatting
startIndex
Purpose: Offset row numbering when using rownum column
Syntax:
Examples:
Complete Example:
Notes:
Numbering starts at
startIndex + 1startIndex="0"starts at 1startIndex="5"starts at 6Use with
rownumspecial columnUseful for continuing numbering across sections
render
Purpose: Conditionally render different values based on multiple conditions
Syntax:
Requirements:
Only works with
<lineitemsSOQL>(not<lineitems>)Must use
<soql>...</soql>tagsInclude all referenced fields in SOQL query
Don't specify field between
<column></column>tagsUse
RECORD.FieldNameto reference row dataEscape HTML tags:
lt#for<,gt#for>
Basic Examples:
String Matching:
Nested Renders:
With Formatting:
Supported Operators:
==
Equals
RECORD.Status == 'Active'
!=
Not equals
RECORD.Type != 'Closed'
>
Greater than
RECORD.Amount > 1000
<
Less than
RECORD.Amount < 100
>=
Greater/equal
RECORD.Amount >= 1000
<=
Less/equal
RECORD.Amount <= 100
&&
AND
(cond1 && cond2)
|
OR
(cond1 | cond2)
STARTSWITH
Begins with
RECORD.Name STARTSWITH 'Pro'
ENDSWITH
Ends with
RECORD.Email ENDSWITH '.com'
HTML Escaping:
<
lt#
>
gt#
"
quot#
'
apos#
&
amp#
Notes:
Evaluates conditions left to right
First matching condition wins
Last value is default (when no conditions match)
Can nest up to 3 levels deep
Use for complex conditional logic in tables

