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

  1. The system identifies the relationship (e.g., Contact → Account)
  2. Fetches the related record
  3. Returns the specified field value
  4. 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:

PlaceholderOutput
{{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

  1. Open the template designer
  2. Look for the Fields panel on the left
  3. Browse available fields by category
  4. 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:

  1. Verify the field name is spelled correctly
  2. Check case sensitivity (field names are case-sensitive)
  3. Ensure the field exists in your data source
  4. Confirm the field has data in the selected record

Wrong Value Displayed

Symptoms: The field shows unexpected data

Solutions:

  1. Verify you're using the correct field name
  2. Check if there are similarly named fields
  3. Confirm the relationship path for lookup fields
  4. Review the data in your source system

Related Field Empty

Symptoms: Lookup fields like {{Account.Name}} are empty

Solutions:

  1. Verify the relationship exists
  2. Check if the parent record is populated
  3. Ensure you have access to the related record
  4. Confirm the relationship name is correct

Date/Number Formatting Issues

Symptoms: Dates or numbers appear in unexpected formats

Solutions:

  1. Check your CRM's locale settings
  2. Date formats typically come from the source system
  3. 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:

ProductQtyPrice
{{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