Merge Fields With Template Editor
Learn what merge fields are, how to add them to a template, and which attributes are most useful day to day.
Inserting Merge Fields
Merge fields pull live Salesforce data into an S-Docs template.
They act as placeholders. At generation time, S-Docs replaces them with record values.
What a merge field looks like
Use this pattern:
{{!Object.Field}}Examples:
{{!Opportunity.Name}}
{{!Opportunity.Account.Name}}
{{!Contact.Email}}You can also apply formatting attributes.
Example:
{{!Opportunity.CloseDate format-date="yyyy-MM-dd"}}How to add a merge field
Quick examples
Plain text field
Parent relationship field
Number formatting
Render rich text content
Replace characters or values
Quick reference: common merge field attributes
This is a practical reference. It covers the most commonly documented attributes.
replaceAll
Replaces matching text inside the merged value.
Use it for cleanup, escaping, or value swaps.
Use multiple pairs when needed.
format-number
Formats numeric output.
Useful for currency, decimals, phone-like masks, and localized separators.
Rich text output and triple braces
Use triple braces when you want to preserve formatting from a rich text field.
Use this when you want line breaks or markup to remain in the output.
format-date
Formats date and datetime values.
Example:
Use this when you need a predictable date format.
Common issues
Wrong object or field API name
Missing relationship path
Special characters not escaped
Rich text output not formatted as expected
Related articles
Last updated
Was this helpful?

