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

When a field is empty, it's replaced with a blank value. But you can go further with visibility conditions to completely hide elements based on your data.


Conditional Rendering (Visibility Conditions)

You can show or hide any element in your template based on field values. This is useful for:

  • Hiding discount rows when there's no discount
  • Showing premium terms only for VIP clients
  • Displaying region-specific content
  • Hiding optional sections

Syntax

Visibility conditions use merge fields with comparison operators:

{{Status}} == 'Active'
{{Amount}} > 1000
{{Discount}} != 0
{{IsPremium}} == true

Supported Operators

OperatorMeaning
==Equal to
!=Not equal to
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal

Value Types

  • Strings: Use single or double quotes: 'Active' or "Active"
  • Numbers: Use without quotes: 1000, 0, 99.99
  • Booleans: Use true or false (no quotes)

Examples

Show discount only when applicable:

{{Discount}} > 0

Display premium terms for VIP accounts:

{{AccountTier}} == 'Premium'

Hide warranty section if not included:

{{IncludeWarranty}} == true

Show EU-specific payment terms:

{{Region}} == 'EU'

Behavior with Empty Fields

If a field referenced in a visibility condition is empty, null, or undefined, the element is hidden by default. This makes it easy to handle missing data gracefullyβ€”no need for explicit null checks.

How to Add a Visibility Condition

  1. Select an element in the template designer
  2. Open the element properties panel
  3. Find the "Visibility Condition" field
  4. Enter your condition expression
  5. Test with different records to verify behavior

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