Merge Fields
Merge fields are the heart of dynamic document generation. They act as placeholders that get replaced with actual data from your connected data sources when you generate a PDF.
Overview
Merge fields use a simple syntax with double curly braces:
{{FieldName}}
When you generate a PDF, {{FirstName}} becomes "John", {{Company}} becomes "Acme Corp", and so on.
Basic Syntax
Simple Fields
Reference a field directly from your selected object:
{{FirstName}}
{{LastName}}
{{Email}}
{{Phone}}
{{CreatedDate}}
Field Name Rules
- Field names are case-sensitive
- Use the exact field name from your data source
- No spaces in field names
- Special characters should be avoided
Parent/Lookup Fields
Access data from related parent records using dot notation:
Syntax
{{ParentObject.FieldName}}
Examples
Salesforce:
{{Account.Name}} ā Parent account name
{{Account.Industry}} ā Account's industry
{{Owner.Name}} ā Record owner's name
{{Owner.Email}} ā Record owner's email
{{CreatedBy.Name}} ā User who created the record
HubSpot:
{{Company.Name}} ā Associated company name
{{Company.Domain}} ā Company's domain
{{Owner.Email}} ā Deal/contact owner email
How It Works
- The system identifies the relationship (e.g., Contact ā Account)
- Fetches the related record
- Returns the specified field value
- Replaces the merge field with the value
Child/Related Fields (for Tables)
Access multiple related records for use in tables:
Syntax
{{ChildRelationship.FieldName}}
Examples
Salesforce:
{{OpportunityLineItems.Name}} ā Product name
{{OpportunityLineItems.Quantity}} ā Quantity
{{OpportunityLineItems.TotalPrice}} ā Line total
{{Contacts.Name}} ā Related contact names
{{Cases.Subject}} ā Related case subjects
HubSpot:
{{line_items.name}} ā Line item name
{{line_items.quantity}} ā Quantity
{{line_items.price}} ā Unit price
Note: Child fields are designed for use in Tables. When used outside a table, only the first record's value will be shown.
Special Merge Fields
Page Numbers
Automatically insert page information:
{{pageNumber}} ā Current page number (1, 2, 3...)
{{totalPages}} ā Total page count
Example usage in footer:
Page {{pageNumber}} of {{totalPages}}
Date and Time
Most data sources provide date fields that you can merge:
{{CreatedDate}}
{{LastModifiedDate}}
{{CloseDate}}
Tip: Date formatting depends on your data source. Salesforce dates come formatted based on your locale settings.
Field Formatting
You can apply formatting to merge fields directly in your template using format specifiers. This allows you to control how currency, dates, and percentages are displayed without changing your source data.
Syntax
{{FieldName:format}}
{{FieldName:format:options}}
Currency Formatting
Format numbers as currency with thousand separators and 2 decimal places:
{{Amount:currency}}
{{TotalPrice:currency}}
{{Account.AnnualRevenue:currency}}
Example:
- Input:
1234.5 - Output:
1 234.50
Note: Currency formatting uses space as thousand separator and dot as decimal separator. No currency symbol is added.
Date Formatting
Format dates with a custom pattern:
{{CreatedDate:date}} ā Default: dd-mm-yyyy
{{CreatedDate:date:dd/mm/yyyy}} ā 23/12/2025
{{CloseDate:date:yyyy-mm-dd}} ā 2025-12-23
{{LastModifiedDate:date:dd.mm.yy}} ā 23.12.25
Available tokens:
dd- Day (01-31)mm- Month (01-12)yyyy- Full year (2025)yy- Short year (25)
Examples:
| Placeholder | Output |
|---|---|
{{Date:date}} | 23-12-2025 |
{{Date:date:dd/mm/yyyy}} | 23/12/2025 |
{{Date:date:yyyy-mm-dd}} | 2025-12-23 |
{{Date:date:mm-dd-yyyy}} | 12-23-2025 |
{{Date:date:dd.mm.yy}} | 23.12.25 |
Percentage Formatting
Format numbers as percentages:
{{Discount:percent}}
{{Probability:percent}}
Example:
- Input:
25(stored as whole number) - Output:
25%
Using in Tables
Format specifiers work in table cells too:
{{LineItems.UnitPrice:currency}}
{{LineItems.Discount:percent}}
{{LineItems.CreatedDate:date:dd/mm/yyyy}}
Using with Parent Fields
Format specifiers work with parent/lookup fields:
{{Account.AnnualRevenue:currency}}
{{Opportunity.CloseDate:date:dd/mm/yyyy}}
Working with Different Data Sources
Salesforce Fields
Standard Fields:
{{Name}}
{{Email}}
{{Phone}}
{{BillingStreet}}
{{BillingCity}}
{{BillingState}}
{{BillingPostalCode}}
{{BillingCountry}}
Custom Fields:
Include the __c suffix for custom fields:
{{Custom_Field__c}}
{{Account_Manager__c}}
Relationship Fields:
{{Account.Name}}
{{Account.Owner.Name}}
{{CreatedBy.Name}}
HubSpot Fields
Contact Properties:
{{firstname}}
{{lastname}}
{{email}}
{{phone}}
{{company}}
Company Properties:
{{name}}
{{domain}}
{{industry}}
{{numberofemployees}}
Deal Properties:
{{dealname}}
{{amount}}
{{closedate}}
{{dealstage}}
SQL Database Fields
Use your column names directly:
{{customer_name}}
{{email_address}}
{{order_total}}
{{created_at}}
Google Sheets Fields
Use your column headers:
{{Name}}
{{Email}}
{{Amount}}
{{Date}}
Finding Available Fields
In the Template Designer
- Open the template designer
- Look for the Fields panel on the left
- Browse available fields by category
- Click a field to insert it at your cursor position
Field Categories
Fields are typically organized by:
- Standard Fields: Built-in fields for the object type
- Custom Fields: Fields you've created
- Related Fields: Fields from parent objects
- Child Relationships: For table data
Field Count
The designer shows you how many fields are available:
Account: 45 fields available
Contact: 38 fields available
Formatting Considerations
Text Wrapping
Long field values will wrap based on your text box size:
- Set appropriate text box widths
- Consider maximum expected content length
- Use multi-line text boxes for addresses
Empty Fields
If a field has no value, the merge field is replaced with an empty string:
Template:
Phone: {{Phone}}
Mobile: {{MobilePhone}}
Result (if MobilePhone is empty):
Phone: (555) 123-4567
Mobile:
Conditional Content
Currently, the system replaces empty fields with blank values. Plan your templates accordingly:
- Use fields that are likely to have values
- Consider required fields in your CRM
- Design layouts that look good with missing data
Best Practices
1. Use Descriptive Context
Add labels to make generated documents clear:
ā
Customer Name: {{Name}}
ā
Email Address: {{Email}}
ā {{Name}}
ā {{Email}}
2. Test with Real Data
Always generate test PDFs with actual records:
- Verify field values appear correctly
- Check formatting and alignment
- Test with records that have missing data
3. Handle Long Values
Prepare for varying content lengths:
- Addresses can be long
- Names vary in length
- Description fields may be extensive
4. Validate Field Names
Before finalizing your template:
- Double-check spelling
- Verify case sensitivity
- Test each merge field
5. Document Your Fields
Keep track of which fields each template uses:
- Add notes in the template description
- Reference your CRM documentation
- Create a field mapping document for complex templates
Troubleshooting
Merge Field Not Replaced
Symptoms: The template shows {{FieldName}} instead of actual data
Solutions:
- Verify the field name is spelled correctly
- Check case sensitivity (field names are case-sensitive)
- Ensure the field exists in your data source
- Confirm the field has data in the selected record
Wrong Value Displayed
Symptoms: The field shows unexpected data
Solutions:
- Verify you're using the correct field name
- Check if there are similarly named fields
- Confirm the relationship path for lookup fields
- Review the data in your source system
Related Field Empty
Symptoms: Lookup fields like {{Account.Name}} are empty
Solutions:
- Verify the relationship exists
- Check if the parent record is populated
- Ensure you have access to the related record
- Confirm the relationship name is correct
Date/Number Formatting Issues
Symptoms: Dates or numbers appear in unexpected formats
Solutions:
- Check your CRM's locale settings
- Date formats typically come from the source system
- Consider using formatted field types in your CRM
Advanced Tips
Combining Fields
Create formatted strings by combining multiple fields:
{{FirstName}} {{LastName}}
{{BillingStreet}}, {{BillingCity}}, {{BillingState}} {{BillingPostalCode}}
Using with Tables
For related records, merge fields become powerful in tables:
| Product | Qty | Price |
|---|---|---|
| {{LineItems.ProductName}} | {{LineItems.Quantity}} | {{LineItems.UnitPrice}} |
Each row automatically repeats for each related record.
Multi-Level Relationships
Access data through multiple levels (where supported):
{{Account.Owner.Name}} ā Account owner's name
{{Account.Parent.Name}} ā Parent account name
Next Steps
- Tables - Use merge fields in dynamic tables
- Templates - Position merge fields in templates
- Integrations - Connect your data sources
