Introduction & Overview
The 360 InstantDocs Word Add-In is a Microsoft Word sidebar that connects directly to your Salesforce organization. It allows you to build smart document templates — Word files that automatically populate with real Salesforce data when a document is generated.
Instead of manually updating every quote, contract, or proposal, you place merge tags (placeholders like {Account.Name} or {Amount}) into your Word document. When a user generates a document from Salesforce, those tags are automatically replaced with live data from the selected record.
Who this guide is for: This guide is written for anyone who wants to create or edit document templates — no technical knowledge required. Every step is explained from scratch.
Related Documentation:
- 360 InstantDocs Installation & Setup Guide — For administrators: installing the package, configuring OAuth, assigning permissions, and initial setup.
- 360 InstantDocs Feature & User Guide — For all users: generating documents from Salesforce records, bulk generation, template management, and more.
How It Works
Login
Browse Templates
Build Template
Preview
Publish
Full Microsoft Word Features Supported
Your templates are real .docx Word files. You have complete freedom to use all standard Word features:
- Headers and footers with page numbers
- Tables with custom borders, shading, and merged cells
- Fonts, colors, bold, italic, underline, strikethrough
- Bullet lists, numbered lists, multi-level lists
- Images, shapes, text boxes, and SmartArt
- Page breaks, section breaks, columns
- Styles, themes, and document templates
- Mail-merge-style layouts
The add-in simply helps you insert dynamic Salesforce placeholders (merge tags). Everything else in the document behaves exactly like a normal Word file.
Getting Started
Prerequisites
- A Salesforce account (Production or Sandbox)
- Microsoft Word for Desktop (Windows or Mac) or Word Online (Microsoft 365 in a browser)
- 360 InstantDocs managed package installed and authorized in your Salesforce org — your administrator must: install the package from AppExchange; open the 360 InstantDocs app → Smart Docs Setup tab; select License Details and click “Authorize & Sync with Server”.
- The 360 InstantDocs add-in installed in Word (contact your administrator if not yet installed)
How to Open the Add-In
Signing In
When you first open the add-in, you will see the login screen with two buttons:
| Button | What it connects to | When to use |
|---|---|---|
| Sign in to Production | Your live Salesforce org (real data, real customers) | When building templates for actual use |
| Sign in to Sandbox | Your test/sandbox Salesforce org (safe to experiment) | When building and testing templates before go-live |
Template Listing Page
After signing in, you will see the Template Listing page — a list of all document templates saved in your Salesforce org.
Searching Templates
Type in the search box at the top of the list. The list filters in real-time as you type. Click the × (clear) button to reset the search.
Sorting Columns
Click any column header to sort the list:
- Name — sort alphabetically by template name
- Object — group by the Salesforce object (Opportunity, Account, etc.)
- Status — sort by Active vs Draft
- Last Modified — sort by most recently edited
Click the same column header again to reverse the sort order.
Status Indicators
| Indicator | Meaning |
|---|---|
| Active (green dot) | Template is live and available to users for document generation |
| Draft (gray dot) | Template is still being built — not yet available to users |
Creating a New Template
Click the New button in the top-right corner of the listing. A new blank template will open and the add-in will move to the CREATE tab.
Opening an Existing Template
Click any row in the list to open that template. The template file will open in Word and the add-in will load the template’s settings.
Building a Template — The CREATE Tab
When creating or editing a template, the add-in shows a 3-step wizard at the top of the panel:
In the CREATE tab, you:
- Select a Primary Object — the object whose fields you want to merge into the template
- Select an Action — what type of content to insert (Field, Conditions, View, or Image)
- Configure the details and click Insert or Copy to place the tag in Word
- Repeat steps 2–3 for every piece of dynamic content in your template
Selecting a Primary Object
The Primary Object is the type of Salesforce record your document is based on. For example:
- Quote — for sales quote documents
- Opportunity — for proposals and deal summaries
- Account — for account profiles and reports
- Contact — for contact sheets or letters
- Order — for order confirmations
Selecting an Action
After selecting an Object, choose an Action from the Action dropdown:
| Action | What it inserts | Example use case |
|---|---|---|
| Field | A single field value from the record | Opportunity name, amount, close date |
| Conditions | Text that shows or hides based on a rule | Show “Approved” section only if approved |
| View | A list of related child records (table, loop, or grid) | All line items on an Opportunity |
| Image | A dynamic image from the record | Company logo, product photo |
Action: Field
What it does: Inserts a single field value from a Salesforce record into your Word document. When a document is generated, the tag is automatically replaced with the actual value from the record.
Example: You place the tag {Account.Name} in your template. When a user generates a document from an Opportunity where the Account is “Acme Corporation”, the tag becomes Acme Corporation in the final document.
Understanding Field Types
When you open the “Select Field” dropdown, fields are grouped by type:
| Icon | Field Type | Examples |
|---|---|---|
| Aa | Text / String | Account Name, Status, Description, Subject |
| # | Number / Currency / Percent | Amount, Discount %, Quantity, Annual Revenue |
| 📅 | Date / Date-Time | Close Date, Created Date, Expiration Date |
| ✓ | Checkbox (True/False) | Is Active, Closed Won, Has Attachment |
| 🔗 | Lookup / Reference (drillable) | Account (on Opportunity), Owner, Campaign, Quote |
| 🌎 | Global Variables | TODAY, Running User (you), Running Org (your company) |
Drilling into Reference (Lookup) Fields
Reference fields (🔗 icon) link to another Salesforce object. Click the › arrow next to a reference field to “drill in” and see that related object’s fields. Maximum depth: 5 levels
Example: Getting the Account Owner’s Email from an Opportunity
{Account.Owner.Email}| Path | Result Tag | What it shows |
|---|---|---|
| Quote → Account → Name | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Account.Name}</code> | The account’s company name |
| Quote → Owner → Email | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Owner.Email}</code> | The quote owner’s email |
| Quote → Account → Owner → Manager → Department | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Account.Owner.Manager.Department}</code> | Manager’s department (4 levels deep) |
| Opportunity → Account → BillingCity | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Account.BillingCity}</code> | The account’s billing city |
Global Variables
Global Variables are available in the 🌎 Globe group in the field selector. These values are automatically calculated each time a document is generated — they do not come from the Salesforce record.
Date Literals
| Tag | What it inserts | Real-world use case |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{TODAY}</code> | Today’s date | Auto-stamps the current date on every document |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{YESTERDAY}</code> | Yesterday’s date | Daily sales reports |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{TOMORROW}</code> | Tomorrow’s date | Urgent deadlines |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_WEEK}</code> | Monday of the current week | Weekly status reports |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_MONTH}</code> | 1st day of the current month | Monthly invoices |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_QUARTER}</code> | 1st day of the current fiscal quarter | Quarterly reviews |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_YEAR}</code> | January 1st of the current year | Annual reports |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CURRENT_YEAR}</code> | Just the 4-digit year number | Copyright footers |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CURRENT_MONTH}</code> | Month as a number (1–12) | Custom date labels |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CURRENT_DAY}</code> | Day of month as a number | Custom date labels |
Running User — The Person Generating the Document
| Tag | What it inserts | Example use |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.FirstName}</code> | First name of the generating user | Personalized “Prepared by” footer |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.LastName}</code> | Last name | Same |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.Email}</code> | Email address | Questions? Contact {User.Email} |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.Title}</code> | Job title | Show the rep’s role below their name |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.Department}</code> | Department name | From the {User.Department} team |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.Phone}</code> | Direct phone number | Call your rep: {User.Phone} |
Prepared by: {User.FirstName} {User.LastName}
Title: {User.Title} | Department: {User.Department}
Email: {User.Email} | Phone: {User.Phone}
Every time a different sales rep generates this template, their own contact information appears automatically.
Running Org — Your Salesforce Organization
| Tag | What it inserts | Example use |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Organization.Name}</code> | Your company/organization name | Letterheads, copyright footers |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Organization.InstanceName}</code> | Salesforce instance identifier | Internal reference only |
{Organization.Name}
Confidential — © {CURRENT_YEAR} {Organization.Name}. All rights reserved.
Step-by-Step: Inserting a Field
Field Formatting Options
Number, Currency & Percent Fields
When you select a numeric field, formatting options appear below the field selector.
- Decimal Places (0–10): How many digits to show after the decimal point.
- Number Format: US (10,000.5), European (10.000,5), International (10 000,5), Indian (1,00,000).
- Currency Symbol: $ (USD), € (Euro), £ (Pound), ¥ (Yen/Yuan), ₹ (Rupee).
Number Tag Syntax: toFixed:N controls decimal places only. format:decimals:'pattern' provides full number format with separators. format:decimals:'pattern':'symbol' adds a currency symbol.
Date & Date Time Fields
When you select a Date or DateTime field, formatting options appear. DateTime fields additionally let you append a time format.
| Format | Example Output |
|---|---|
| MM/DD/YYYY | 12/31/2024 |
| DD/MM/YYYY | 31/12/2024 |
| YYYY/MM/DD | 2024/12/31 |
| MMMM DD, YYYY | December 31, 2024 |
| MMM DD, YYYY | Dec 31, 2024 |
| DD MMMM YYYY | 31 December 2024 |
Time Format (DateTime only): hh:mm A (03:45 PM), HH:mm (15:45), hh:mm:ss A, HH:mm:ss
Add Days / Subtract Days: Offset the date by a set number of days. Example: {InvoiceDate | addDays:30} for payment due date.
Tag Examples
{Name}
{Account.Name}
{Account.Owner.Email}
{CloseDate | formatDate:'MMMM DD, YYYY'}
{Amount | format:2:'10,000,000.5':'$'}
{TotalPrice | toFixed:2}
{CloseDate | addDays:30 | formatDate:'MM/DD/YYYY'}
{TODAY | formatDate:'MM/DD/YYYY'}
{User.FirstName} {User.LastName}
© {CURRENT_YEAR} {Organization.Name}
Action: Conditions
What it does: Shows or hides a block of text in the document based on a rule you define. Think of it as: “if this condition is true, then show this content.”
Example: Only show a “Terms & Conditions” section if the customer is an Enterprise client.
If Block vs. If/Else Statement
Type 1 — If Block
Content is shown only when the condition is TRUE. If FALSE, nothing is shown — the section is completely hidden.
Best for: Large optional blocks — entire paragraphs, multi-line clauses, full sections.
- Show a full “Terms & Conditions” section only for Enterprise tier customers
- Show a “California Residents” legal clause only when Billing State = “CA”
- Show “Installation Instructions” only when Product Type = “Hardware”
Type 2 — If/Else Statement
Shows Content A when TRUE, or Content B when FALSE. Something always appears — it just changes based on the data.
Best for: Short inline labels, single words, or one-line phrases that need two versions.
- Amount > $10,000 → show “Premium Client” else show “Standard Client”
- Is Active → show “Active Account” else show “Inactive Account”
- Stage = “Closed Won” → show “✓ Closed” else show “○ Open”
Nested Conditions
You can place a condition inside another condition to build complex logic. This is done by typing tags directly into your Word document.
{#Region == "North America"}
North American Standard Terms Apply.
{#CustomerType == "Enterprise"}
Enterprise SLA: 4-hour guaranteed response time, 24/7 support.
{/}
{/}
Operators & Multiple Conditions
| Operator | Meaning | Example |
|---|---|---|
| == | Equals exactly | Status == “Approved” |
| != | Does not equal | Status != “Draft” |
| > | Greater than | Amount > 10000 |
| < | Less than | Discount < 5 |
| >= | Greater than or equal to | Score >= 80 |
| <= | Less than or equal to | Days <= 30 |
| contains | Field value contains this text | Name contains “Corp” |
| startsWith | Field value starts with this text | Email startsWith “info@” |
| endsWith | Field value ends with this text | Email endsWith “@gmail.com” |
Click “Add Condition” to add more condition rows. Connect them with AND (&&) — ALL must be true, or OR (||) — if ANY one is true.
Step-by-Step: Building a Condition
Real-Life Examples
Example 1 — If Block: Finance Approval Notice
{#ApprovalStatus == "Approved"}
This quote has been reviewed and approved by the Finance department. All pricing and terms are final.
{/}
Example 2 — If/Else Block: Deal Tier Label
{#Amount > 50000}
ENTERPRISE DEAL — VP Approval Required
{/}
{^Amount > 50000}
STANDARD DEAL — Standard Terms Apply
{/}
Example 3 — Multiple Conditions (AND)
{#Status == "Active" && Type == "New Customer"}
⭐ Priority New Customer — Please attach the Onboarding Checklist.
{/}
Example 4 — Multiple Conditions (OR)
{#PaymentMethod == "Check" || PaymentMethod == "Wire Transfer"}
Please allow 5–7 business days for payment processing.
{/}
Custom Conditions — Direct Document Editing (Advanced)
Syntax: {field operator value ? "text if true" : "text if false"}
{StageName == "Closed Won" ? "Deal Closed — Begin Onboarding" : "Deal In Progress"}
{Amount > 10000 ? "High Value Account" : "Standard Account"}
{IsActive ? "Active Customer" : "Former Customer"}
Action: View
What it does: Inserts a repeating block that lists all related child records from Salesforce into your document. For example, all the products on a quote, all contacts at an account, or all tasks on an opportunity.
Three Layout Types
| Layout | What it looks like | Best for | Real-world example |
|---|---|---|---|
| Table | Rows and columns — like a spreadsheet | Structured data where comparison across columns is useful | Opportunity Line Items (Product | Qty | Unit Price | Total) |
| Loops | Each record is a repeated block of formatted text | Narrative or labeled fields — one “card” per record | Contact directory (Name, Title, Email, Phone) |
| Grid | Records in multiple columns side-by-side (2–4 per row) | Compact visual display of many items | Product catalog (Name + Price in cards, 3 per row) |
Complete Step-by-Step: Creating a View
Step 1: Select View Type
From the View Type dropdown, choose Table, Loops, or Grid.
Step 2: Select Child Relationship
This is the related list (child object) connected to your primary object. Examples:
- Primary Object = Quote → QuoteLineItems, Contacts, Attachments
- Primary Object = Account → Contacts, Opportunities, Cases, Orders
- Primary Object = Opportunity → OpportunityLineItems, Tasks, Events, Notes
Step 3: (Optional) Using Parent Fields Inside a Loop
Inside a loop, you can reference fields from the parent record. Use dot notation: {Opportunity.Name} inside an OpportunityLineItems loop.
Step 4: Add Fields to “Selected Fields”
Step 5: Reorder Your Fields
Drag and drop a field in the Selected Fields list to your desired position. Each field displays a number indicating its current position.
Step 6: Set Row Count (Row Limit)
Enter the maximum number of child records to include. Example: Enter 10 → only the first 10 records are shown. Leave blank or enter 0 for unlimited (all records).
Step 7–8: Set Sort Field & Sort Direction
ASC (Ascending): A → Z, 0 → 9, Oldest → Newest. DESC (Descending): Z → A, 9 → 0, Newest → Oldest.
Step 9: (Grid only) Set Grid Columns
Choose how many cards appear per row: 2, 3, or 4 columns.
Step 10: Insert or Copy
Click Insert to place the view block at your cursor in Word, or Copy to paste it manually.
Real-Life Examples
Example 1 — Table: Quote Line Items
| Setting | Value |
|---|---|
| View Type | Table |
| Child Relationship | QuoteLineItems |
| Selected Fields | Product Name, Description, Quantity, Unit Price, Total Price |
| Sort Field | Product Name |
| Sort Direction | ASC |
| Row Count | 50 |
Example 2 — Loops: Contact Directory
| Setting | Value |
|---|---|
| View Type | Loops |
| Child Relationship | Contacts |
| Selected Fields | First Name, Last Name, Title, Email, Phone |
| Sort Field | Last Name |
| Sort Direction | ASC |
| Row Count | 10 |
Example 3 — Grid: Product Brochure Catalog
| Setting | Value |
|---|---|
| View Type | Grid |
| Child Relationship | Products (or OpportunityLineItems) |
| Selected Fields | Product Name, Short Description, Price |
| Grid Columns | 3 |
Summarize / Aggregate & Calc (Advanced)
Summarize / Aggregate (Advanced — Direct Document Entry)
The system supports summing a numeric field across all child records. Type the tag directly into your Word document.
Syntax: {RelationshipName | sumBy:'FieldName'}
Total Amount: {OpportunityLineItems | sumBy:'TotalPrice'}
Grand Total: {OpportunityLineItems | sumBy:'TotalPrice' | format:2:'10,000,000.5':'$'}
Total Items Ordered: {OpportunityLineItems | sumBy:'Quantity'}
Calc — Expression Evaluator (Advanced)
The calc filter is a powerful expression evaluator for arithmetic, comparisons, and logical operations. Syntax: {Input | calc:'expression'}
Arithmetic on Child Record Fields
{OpportunityLineItems | calc:'TotalPrice'}
{OpportunityLineItems | calc:'UnitPrice * Quantity'}
{OpportunityLineItems | calc:'(UnitPrice * Quantity) / 100' | toFixed:2}
{OpportunityLineItems | calc:'TotalPrice - 10%' | toFixed:2}
Using Parent Record Values ($1, $2, …)
{OpportunityLineItems | calc:'TotalPrice - $1':Amount | toFixed:2}
{OpportunityLineItems | calc:'TotalPrice - $1 + $2':Amount:Discount__c | toFixed:2}
Length — Count Records or Characters
{OpportunityLineItems | calc:'length'}
{Name | calc:'length'}
Conditions — Show / Hide Content
{#OpportunityLineItems | calc:'length > 0'}
This opportunity has {OpportunityLineItems | calc:'length'} line items.
{/}
{#OpportunityLineItems | calc:'length > 5'} Large order — qualifies for bulk discount.
{/}
| Operator | Description | Example |
|---|---|---|
| + | Addition | calc:’TotalPrice + 100′ |
| – | Subtraction | calc:’TotalPrice – Discount’ |
| * | Multiplication | calc:’UnitPrice * Quantity’ |
| / | Division (0 returns 0) | calc:’TotalPrice / Quantity’ |
| N% | Percentage of left operand | calc:’TotalPrice – 10%’ |
| >, <, >=, <= | Comparison | calc:’length > 0′ |
| && | Logical AND | calc:’length > 0 && length < 100′ |
| || | Logical OR | calc:’length == 0 || length > 10′ |
Action: Image
What it does: Inserts a dynamic image from a Salesforce record into your document. The image is fetched and embedded automatically when the document is generated.
Common uses: Company or account logo in the document header; product photos in a catalog; user profile photos; signature images in contracts.
Step-by-Step: Inserting an Image
Image Tag Syntax
Image tags use the %Img(...) function with three arguments: the source (URL or File Id), width, and height in pixels.
{%Img('069dM00000OdBPBQA3', 300, 300)}
{%Img('https://example.com/logo.png', 300, 300)}
{%Img(ImageId__c, 300, 300)}
| Tag | What it inserts |
|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(‘069dM00000OdBPBQA3’, 300, 300)}</code> | File from Salesforce by ContentDocumentId, sized 300×300px |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(‘https://example.com/logo.png’, 300, 300)}</code> | Image fetched from a public URL |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(ImageId__c, 300, 300)}</code> | Resolves the field value at runtime (field should contain a URL or File Id) |
Quoted vs unquoted source: Wrap a literal URL or File Id in single quotes. Use a bare field API name (no quotes) when the source value lives on the record.
{%Img(Account.LogoUrl__c, 200, 60)}
{Organization.Name}
Prepared by: {User.FirstName} {User.LastName} | {User.Title}
Date: {TODAY | formatDate:'MMMM DD, YYYY'}
Supported image formats: PNG, JPEG/JPG, SVG
Copy vs. Insert — Which Should I Use?
After configuring any field, condition, view, or image in the add-in, you will see two buttons at the bottom: Copy and Insert.
| Copy | Insert | |
|---|---|---|
| What it does | Copies the generated tag to your clipboard | Places the tag directly at your cursor position in Word |
| Then what | Switch to Word, click where you want it, press Ctrl+V to paste | Nothing else needed — the tag is already placed |
| Best for | Placing a tag inside a Word table cell, or at a very specific location | When building the template sequentially from top to bottom |
| Confirmation | Button briefly shows “Copied ✓” | Button briefly shows “Inserted ✓” |
Preview Tab — Test Your Template (Step 2)
What it does: Renders your template with real Salesforce data so you can see exactly what the final generated document will look like — before you publish anything.
Step-by-Step: Using the Preview Tab
Understanding Preview Results
| What you see | What it means | What to do |
|---|---|---|
| All fields show real values | Template is working correctly | Ready to publish! |
| Some fields are blank | That field is empty on the selected record | Try a different record that has data |
| An error message appears | A tag has a typo, deleted field, or syntax error | Go to CREATE tab → fix the tag |
| Wrong value displayed | You selected the wrong field in the add-in | Remove the tag, re-select the correct field |
| Condition always shows/hides | The condition logic may be inverted | Test with records where condition should be both true and false |
Best Practices for Previewing
- Test with at least 2–3 different records, including edge cases
- Test with a record that has empty optional fields
- For every condition, test with TRUE and FALSE records
- Use sandbox records with realistic test data
- Do not edit the document during preview — any changes will be lost
Live Tab — Publish Your Template (Step 3)
What it does: Saves your finished template to Salesforce and makes it available for users to generate documents.
Fields Explained
| Field | Description | Example |
|---|---|---|
| Primary Object | (Read-only) The Salesforce object this template is for | Opportunity |
| Template Name | The internal name used to find this template in the listing | 2024 Sales Opportunity Template |
| Document Name | The filename for generated documents. Supports merge tags! | Opportunity_{Name} |
| Status | Draft = still building | Active = live and ready | Active |
| Document Type | Format of the generated file | Doc, PDF, or Any |
Status Options
| Status | What it means | When to use |
|---|---|---|
| Draft | Template is saved but NOT available to users for document generation | While you are still building or testing |
| Active | Template IS available to users for document generation | When fully tested and ready to use |
Document Type Options
| Type | What it generates |
|---|---|
| Doc | Always generates a Microsoft Word (.docx) file |
| Always generates a PDF file | |
| Any | User chooses between Word and PDF at the time of generation |
Smart Document Naming
The Document Name field supports merge tags — making every generated file uniquely named.
| Document Name you enter | Generated filename |
|---|---|
| Opportunity_{Name} | Opportunity_Green Farm Deals |
| {Account.Name}_Proposal | Acme Corporation_Proposal |
| Proposal_{TODAY | formatDate:’MM-DD-YYYY’} | Proposal_01-15-2024 |
Step-by-Step: Publishing Your Template
Tag Syntax Quick Reference
Basic Field Tags
| Tag | Example | Description |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{FieldName}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Name}</code> | Simple field value (case-insensitive) |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Object.Field}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Account.Name}</code> | Nested lookup field (up to 5 levels) |
Formatting Tags
| Tag | Example | Description |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | formatDate:’format’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CloseDate | formatDate:’MM/DD/YYYY’}</code> | Format a Date or DateTime field |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | toFixed:N}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{TotalPrice | toFixed:2}</code> | Set decimal places only |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | format:N:’pattern’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Amount | format:0:’10,000,000.5′}</code> | Full number format with separators |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | format:N:’pattern’:’symbol’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Amount | format:2:’10,000,000.5′:’$’}</code> | Full number format with currency symbol |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | addDays:N}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CloseDate | addDays:30}</code> | Offset date forward by N days |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Field | subtractDays:N}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{ContractEndDate | subtractDays:14}</code> | Offset date backward by N days |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Rel | orderBy:’Field’:’asc’|’desc’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#Contacts | orderBy:’LastName’:’asc’}</code> | Order rows in a view |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Rel | limit:N}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#OpportunityLineItems | limit:10}</code> | Limit rows in a view |
Conditional Tags
| Tag | Description |
|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#field == “val”}content{/}</code> | If Block — show content when condition is true |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#Cond}yes{/} {^Cond}no{/}</code> | If/Else block — manual pattern with ^ for false branch |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Condition ? “yes” : “no”}</code> | Inline ternary — TRUE/FALSE values may be literal text or field names |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#f1 == “v1” && f2 == “v2”}…{/}</code> | Multiple conditions with AND |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#f1 == “v1” || f2 == “v2”}…{/}</code> | Multiple conditions with OR |
View / Loop Tags
| Tag | Example | Description |
|---|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#Relationship}…{/Relationship}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{#OpportunityLineItems}…{/OpportunityLineItems}</code> | Loop through child records |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Rel|sumBy:’Field’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{OpportunityLineItems|sumBy:’TotalPrice’}</code> | Sum a numeric field across all child records |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Rel|calc:’expression’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{OpportunityLineItems|calc:’TotalPrice -10%’}</code> | Evaluate an arithmetic expression |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Rel|calc:’length’}</code> | <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{OpportunityLineItems|calc:’length’}</code> | Count child records |
Image Tags
| Tag | Description |
|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(‘SF File Id’, W, H)}</code> | Insert a Salesforce file by ContentDocumentId or ContentVersionId |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(‘url’, W, H)}</code> | Insert an image fetched from a public URL |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{%Img(FieldApiName, W, H)}</code> | Resolve the source from a record field at runtime — no quotes around field name |
Global Variable Tags
| Tag | Description |
|---|---|
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{TODAY}</code> | Today’s date |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{YESTERDAY}</code> | Yesterday’s date |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_WEEK}</code> | Monday of the current week |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_MONTH}</code> | 1st of the current month |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_QUARTER}</code> | 1st of the current fiscal quarter |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{THIS_YEAR}</code> | January 1st of the current year |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{CURRENT_YEAR}</code> | Current year as a 4-digit number |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{User.FirstName}</code> | Fields from the user generating the document |
| <code style=”background:#f4f6f8;border:1px solid #e2e8f0;border-radius:4px;padding:2px 6px;font-family:Consolas,Monaco,monospace;font-size:14px;”>{Organization.Name}</code> | Your Salesforce organization name |
Tips & Best Practices
- Start in Sandbox: Always build and test templates in your Salesforce Sandbox before creating them in Production.
- Draft first, Active later: Keep Status = Draft while building. Only switch to Active once thoroughly previewed.
- Preview with multiple records: Test with at least 3 different records. Include records where optional fields are empty.
- Test both sides of every condition: Preview with TRUE and FALSE records for every If Block and If/Else.
- Use unique Document Names: Include merge tags like {Account.Name}_{Name} so generated files are easy to find.
- Cursor position for Insert: Always click inside the Word document before clicking Insert.
- Tags inside table cells: Use Copy → click inside the table cell → Ctrl+V for precise placement.
- Use Add Days for deadline calculations: {InvoiceDate|addDays:30} for payment due dates.
- Smart quote warning: Use straight quotes (“) not curly quotes. Press Ctrl+Z if Word autocorrects.
- Don’t forget headers and footers: You can place merge tags inside Word headers and footers too.
Troubleshooting
| Problem | Likely Cause | Solution |
|---|---|---|
| Error: “Field not found” | The field was renamed or deleted in Salesforce | Re-select the field in the add-in, or update the tag to match the current field API name |
| Preview shows blank where a value should be | That field is empty on the selected record | Try a different record that has data in that field |
| Insert button does nothing | No cursor position set in Word | Click inside the Word document to position your cursor, then click Insert again |
| Login fails or authentication error | OAuth or External Client App misconfiguration | Contact your Salesforce administrator |
| Template doesn’t appear in the listing | Wrong environment or template is Draft | Check you are signed into the correct environment. Set Status to Active |
| Smart quote error in tag | Word autocorrected quotes to curly/smart quotes | Replace curly quotes with straight quotes in the tag |
| Image shows as broken/missing | The image field is empty or invalid | Verify the field value exists and contains a valid image in Salesforce |
| Sum total shows 0 or wrong value | Wrong field API name in sumBy tag (case-sensitive) | Use the exact Salesforce API field name |
| Template saves but users cannot find it | Status is still set to Draft | Go to the Live tab, change Status to Active, and click Save again |
| View/Loop shows no records | The selected record has no child records | Test with a different record that has data in the related list |
| Condition always shows or always hides | Condition logic is inverted or wrong value | Check the field value in the actual Salesforce record |
| My preview edits disappeared | Edits made in Preview mode are not saved | Make changes in the CREATE tab, then re-preview |
© 2026 360 InstantDocs. All rights reserved.