Building Templates - Magic Merge Knowledge Base

Building Templates

Templates are the foundation of Magic Merge. They define the structure and content of your generated documents, pulling live Salesforce data into professionally formatted outputs. This guide covers template types, configuration options, and the text editor features you'll use to build dynamic documents.

Template Types

Choose the appropriate template type based on your output needs and delivery method.

PDF

Generate professional PDF documents from Salesforce data. Ideal for contracts, proposals, invoices, and formal reports.

Email

Create dynamic email templates that merge Salesforce data directly into content. Perfect for personalized communications and automated notifications.

Actions Section

Configure essential settings for your merge template including data relationships, file management, and versioning.

Field Settings

Configure field formatting, default values, and conditional display rules for individual fields in your template. Control how data appears when merged—including date formats, currency symbols, and fallback text for empty fields.

Child Objects

Define parent-child record relationships to include related object data in your merge template. Link Opportunity Line Items to Opportunities, Contacts to Accounts, or any custom relationship in your org.

Merge Files

Control file creation, naming, and storage settings for documents generated by the merge process. Configure dynamic file names using merge fields, specify output folders, and set file format options.

Post Merge

Configure automated workflows, field updates, or custom logic to execute after merge completion. Trigger follow-up tasks, update record statuses, or send notifications when documents are generated.

Template Versions

Track and manage template versions with backup, comparison, and rollback capabilities. View version history, compare changes between versions, and restore previous versions when needed.

Text Editor

Build dynamic document templates that pull and format Salesforce data using these editor features.

Tables

Create structured data presentations using HTML tables for organized display of line items and summaries. Tables automatically expand to accommodate child record data during merge.

Adding Child Records

Display multiple related records using child object relationships configured in the Actions section. Each child record creates a new row or section in your output document.

Merge Fields

Insert dynamic Salesforce field values using merge field syntax. Placeholders are replaced with actual data during merge.

Merge Field Syntax

Use Case Syntax
Basic field merge {FieldName}
Child record field {C1.FieldName}
Lookup relationship field {LookupField>ParentFieldName}
Relabel field display {FieldName|New Label}

Tip: Use the field picker in the editor to browse available fields and insert merge syntax automatically—no need to memorize field API names.

Getting Started

Create your first template in minutes:

1

Navigate to Magic Merge → Templates and click New Template

2

Choose your template type (PDF or Email) and select the primary Salesforce object

3

Configure child object relationships if your template needs related record data

4

Use the text editor to build your document layout and insert merge fields

5

Preview with sample data, then save and activate your template

Need Help? Check out our template gallery for examples and pre-built templates you can customize for your use case.