Talk to Us

Word Add-In User Guide

Table of Contents

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

Step 1
Login
Step 2
Browse Templates
Step 3
Build Template
Step 4
Preview
Step 5
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.

Note: Document templates must be created and edited in Microsoft Word using this Add-In. You cannot create or edit templates with merge fields directly within Salesforce. The Salesforce template record stores metadata (name, object, document type), but the actual template file (.docx) must be designed here in Word using the Add-In.
Tip: You do not have to use the add-in for every tag. If you know the field name and the tag format, you can type merge tags directly into your Word document. See Tag Syntax Quick Reference for all supported formats.
The 360 InstantDocs add-in panel open alongside a Word document

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

1Open Microsoft Word on your computer.
2Go to the Home tab in the Word ribbon.
3Click Add-ins or My Add-ins.
4Find 360 InstantDocs in the list and click Add.
5The 360 InstantDocs panel will appear on the right side of your Word window.
Opening the add-in from Word's Insert tab → Add-ins

Signing In

When you first open the add-in, you will see the login screen with two buttons:

ButtonWhat it connects toWhen to use
Sign in to ProductionYour live Salesforce org (real data, real customers)When building templates for actual use
Sign in to SandboxYour test/sandbox Salesforce org (safe to experiment)When building and testing templates before go-live
1Click either Sign in to Production or Sign in to Sandbox depending on your environment.
2A Salesforce login window will open in your browser or as a dialog.
3Enter your Salesforce username and password and click Log In.
4If prompted, click Allow to authorize 360 InstantDocs to access your Salesforce data.
5You will be redirected back to the add-in, now logged in and showing your templates.
Warning: Login Failed? If you see an authentication error, contact your Salesforce administrator. They may need to check the External Client App settings or grant you access to the 360 InstantDocs application.
The login screen — choose Production or Sandbox

Template Listing Page

After signing in, you will see the Template Listing page — a list of all document templates saved in your Salesforce org.

The Template Listing page

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

IndicatorMeaning
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.

Tip: If you have many templates, the list loads 20 at a time. Scroll to the bottom to automatically load more.

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:

CREATE
PREVIEW
LIVE

In the CREATE tab, you:

  1. Select a Primary Object — the object whose fields you want to merge into the template
  2. Select an Action — what type of content to insert (Field, Conditions, View, or Image)
  3. Configure the details and click Insert or Copy to place the tag in Word
  4. Repeat steps 2–3 for every piece of dynamic content in your template
The CREATE tab — 3-step wizard and Object & Action selection

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
1Click the Select Object dropdown.
2Type to search for your object (e.g., type “opportunity” to find Opportunity).
3Select your object from the list.
Warning: The Primary Object cannot be changed after the template has been saved for the first time. Choose carefully before saving.
Selecting a Primary Object from the dropdown

Selecting an Action

After selecting an Object, choose an Action from the Action dropdown:

ActionWhat it insertsExample use case
FieldA single field value from the recordOpportunity name, amount, close date
ConditionsText that shows or hides based on a ruleShow “Approved” section only if approved
ViewA list of related child records (table, loop, or grid)All line items on an Opportunity
ImageA dynamic image from the recordCompany 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:

IconField TypeExamples
AaText / StringAccount Name, Status, Description, Subject
#Number / Currency / PercentAmount, Discount %, Quantity, Annual Revenue
📅Date / Date-TimeClose Date, Created Date, Expiration Date
Checkbox (True/False)Is Active, Closed Won, Has Attachment
🔗Lookup / Reference (drillable)Account (on Opportunity), Owner, Campaign, Quote
🌎Global VariablesTODAY, 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

1On an Opportunity template, open the field selector.
2Find Account (reference field 🔗) and click the › arrow — you are now inside Account fields.
3Find Owner (reference field 🔗) and click the › arrow — you are now inside User (Owner) fields.
4Select Email.
5The resulting tag is: {Account.Owner.Email}
PathResult TagWhat 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
The field selector showing field types with icons Drilling into a reference field — click the › arrow to navigate deeper

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

TagWhat it insertsReal-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 dateAuto-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 dateDaily 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 dateUrgent 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 weekWeekly 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 monthMonthly 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 quarterQuarterly 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 yearAnnual 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 numberCopyright 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 numberCustom date labels

Running User — The Person Generating the Document

TagWhat it insertsExample 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 userPersonalized &ldquo;Prepared by&rdquo; 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 nameSame
<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 addressQuestions? 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 titleShow 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 nameFrom 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 numberCall 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

TagWhat it insertsExample 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 nameLetterheads, 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 identifierInternal reference only
{Organization.Name}
Confidential — © {CURRENT_YEAR} {Organization.Name}. All rights reserved.

Step-by-Step: Inserting a Field

1Make sure you have selected a Primary Object (e.g., Opportunity).
2From the Action dropdown, choose Field.
3Click the Select Field dropdown to open the field browser.
4Browse or type to search for your field (e.g., type “account” to find Account-related fields).
5If you see a field with a › chevron (reference/lookup field), click it to drill into that related object.
6Click your target field to select it.
7If the field is a number, currency, or date type, configure formatting options that appear below.
8Click Insert to place the tag at your cursor in Word, or Copy to copy it to your clipboard.
Tip: Click inside your Word document first to position your cursor before clicking Insert. The tag will be placed exactly where your cursor is.

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 formatting options
1Select a numeric, currency, or percent field from the field selector.
2Set the Decimal Places (e.g., 2 for money, 0 for whole numbers).
3Choose the Number Format appropriate for your document’s region.
4Choose a Currency Symbol if the field represents money.
5Click Insert or Copy.

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.

FormatExample Output
MM/DD/YYYY12/31/2024
DD/MM/YYYY31/12/2024
YYYY/MM/DD2024/12/31
MMMM DD, YYYYDecember 31, 2024
MMM DD, YYYYDec 31, 2024
DD MMMM YYYY31 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.

Date formatting options
1Select a Date or DateTime field.
2Choose a Date Format from the dropdown.
3(DateTime only) Choose a Time Format if you need a time component.
4(Optional) Enter a number in Add Days or Subtract Days to offset the date.
5Click Insert or Copy.

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

OperatorMeaningExample
==Equals exactlyStatus == “Approved”
!=Does not equalStatus != “Draft”
>Greater thanAmount > 10000
<Less thanDiscount < 5
>=Greater than or equal toScore >= 80
<=Less than or equal toDays <= 30
containsField value contains this textName contains “Corp”
startsWithField value starts with this textEmail startsWith “info@”
endsWithField value ends with this textEmail 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

1Make sure your Primary Object is selected.
2From the Action dropdown, choose Conditions.
3Choose the condition type: If Block or If/Else Statement.
4Select a Field from the dropdown (e.g., StageName).
5Choose an Operator from the dropdown (e.g., ==).
6Enter a Value in the text box (e.g., type Closed Won).
7(Optional) Click Add Condition to add another rule, then choose AND or OR.
8In the Content text box, type the text to show when the condition is TRUE.
9(If/Else only) In the Alternate Content text box, type the text to show when FALSE.
10Click Insert or Copy.
Setting up an If Block condition If/Else statement with Content and Alternate Content

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"}
1Click in your Word document where you want the inline condition.
2Type the tag using the inline If/Else syntax shown above.
3Use straight quotes (“) — not Word’s curly/smart quotes.
4If Word autocorrects your quotes, press Ctrl+Z immediately to undo.
5Go to the PREVIEW tab to verify the condition renders correctly.
Inline If/Else condition typed directly in a Word document

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

LayoutWhat it looks likeBest forReal-world example
TableRows and columns — like a spreadsheetStructured data where comparison across columns is usefulOpportunity Line Items (Product | Qty | Unit Price | Total)
LoopsEach record is a repeated block of formatted textNarrative or labeled fields — one “card” per recordContact directory (Name, Title, Email, Phone)
GridRecords in multiple columns side-by-side (2–4 per row)Compact visual display of many itemsProduct 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.

Choosing a View Type

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
1Click the Select Field dropdown to open the field browser.
2Browse or type to search for a relationship field (look for the 🔗 reference icon).
3Click the › chevron next to a reference/lookup field to drill into that related object.
4Continue drilling deeper through relationship fields as needed (up to 5 levels).
Selecting the child relationship using the field dropdown

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.

Accessing parent record fields inside a loop

Step 4: Add Fields to “Selected Fields”

1Click the Select Field dropdown to open the field browser.
2Browse or type to search for your desired field.
3Click the › chevron to drill into reference fields if needed.
4Click your target field to select it — it will be added to the Selected Fields list.
5Repeat to add more fields.
6To remove: Click the remove button next to a field in the Selected Fields list.
Selecting fields using the dropdown and viewing them in the Selected Fields list

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.

Reordering Selected Fields by dragging and dropping

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.

The generated view tag and output options

Real-Life Examples

Example 1 — Table: Quote Line Items

SettingValue
View TypeTable
Child RelationshipQuoteLineItems
Selected FieldsProduct Name, Description, Quantity, Unit Price, Total Price
Sort FieldProduct Name
Sort DirectionASC
Row Count50

Example 2 — Loops: Contact Directory

SettingValue
View TypeLoops
Child RelationshipContacts
Selected FieldsFirst Name, Last Name, Title, Email, Phone
Sort FieldLast Name
Sort DirectionASC
Row Count10

Example 3 — Grid: Product Brochure Catalog

SettingValue
View TypeGrid
Child RelationshipProducts (or OpportunityLineItems)
Selected FieldsProduct Name, Short Description, Price
Grid Columns3

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'}
1Click in your Word document where you want the total to appear.
2Type: {OpportunityLineItems | sumBy:’TotalPrice’}
3Replace OpportunityLineItems with your actual child relationship name.
4Replace TotalPrice with the exact Salesforce API field name (case-sensitive).
5Add formatting if needed.
6Go to the Preview tab to verify the sum calculates correctly.
Note: Field names in sumBy must match the Salesforce API name exactly (e.g., TotalPrice not Total Price).

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.
{/}
OperatorDescriptionExample
+Additioncalc:’TotalPrice + 100′
Subtractioncalc:’TotalPrice – Discount’
*Multiplicationcalc:’UnitPrice * Quantity’
/Division (0 returns 0)calc:’TotalPrice / Quantity’
N%Percentage of left operandcalc:’TotalPrice – 10%’
>, <, >=, <=Comparisoncalc:’length > 0′
&&Logical ANDcalc:’length > 0 && length < 100′
||Logical ORcalc:’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

1Select your Primary Object.
2From the Action dropdown, choose Image.
3Choose the Source Type: URL — a publicly accessible image URL, or Salesforce File Id — a ContentDocumentId or ContentVersionId.
4Enter the value based on the source type you chose.
5Set the Width and Height (in pixels).
6Click Insert or Copy.
Image action — choose source type, enter URL or File Id, then set size

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)}
TagWhat 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.

CopyInsert
What it doesCopies the generated tag to your clipboardPlaces the tag directly at your cursor position in Word
Then whatSwitch to Word, click where you want it, press Ctrl+V to pasteNothing else needed — the tag is already placed
Best forPlacing a tag inside a Word table cell, or at a very specific locationWhen building the template sequentially from top to bottom
ConfirmationButton briefly shows “Copied ✓”Button briefly shows “Inserted ✓”
Tip: For Insert to work: Click inside your Word document first to set your cursor position before clicking Insert. When inserting tags inside Word table cells, use Copy, then click inside the correct table cell and press Ctrl+V.

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.

Caution: Do NOT Edit the Document in Preview Mode. Any edits you make to the Word document while in Preview mode are NOT saved back to your template. Preview is for viewing only. If you spot something that needs fixing, go back to the CREATE tab and make the correction there, then re-preview.

Step-by-Step: Using the Preview Tab

1Click the PREVIEW tab at the top of the add-in panel (Step 2 in the wizard).
2In the Preview Record section, you will see a search box.
3Type the name of a record to search (e.g., type “Acme” to find records related to Acme Corporation).
4Select a record from the dropdown results.
5The add-in generates your template with that record’s real data and displays the result in Word.
6Review the document carefully — check that all fields, conditions, and tables render correctly.
7If you see an error or something unexpected, note what is wrong → go back to the CREATE tab → fix the tag → return to PREVIEW and repeat.
The Preview tab — search for and select a record Preview result — template rendered with real data

Understanding Preview Results

What you seeWhat it meansWhat to do
All fields show real valuesTemplate is working correctlyReady to publish!
Some fields are blankThat field is empty on the selected recordTry a different record that has data
An error message appearsA tag has a typo, deleted field, or syntax errorGo to CREATE tab → fix the tag
Wrong value displayedYou selected the wrong field in the add-inRemove the tag, re-select the correct field
Condition always shows/hidesThe condition logic may be invertedTest 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.

The Live tab — publish your template

Fields Explained

FieldDescriptionExample
Primary Object(Read-only) The Salesforce object this template is forOpportunity
Template NameThe internal name used to find this template in the listing2024 Sales Opportunity Template
Document NameThe filename for generated documents. Supports merge tags!Opportunity_{Name}
StatusDraft = still building | Active = live and readyActive
Document TypeFormat of the generated fileDoc, PDF, or Any

Status Options

StatusWhat it meansWhen to use
DraftTemplate is saved but NOT available to users for document generationWhile you are still building or testing
ActiveTemplate IS available to users for document generationWhen fully tested and ready to use

Document Type Options

TypeWhat it generates
DocAlways generates a Microsoft Word (.docx) file
PDFAlways generates a PDF file
AnyUser 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 enterGenerated filename
Opportunity_{Name}Opportunity_Green Farm Deals
{Account.Name}_ProposalAcme Corporation_Proposal
Proposal_{TODAY | formatDate:’MM-DD-YYYY’}Proposal_01-15-2024

Step-by-Step: Publishing Your Template

1Click the LIVE tab (Step 3 in the wizard).
2Confirm the Primary Object shown (read-only).
3Enter a descriptive Template Name (e.g., “2024 Sales Opportunity Template”).
4Enter a Document Name. Use merge tags for unique, meaningful filenames.
5Set Status: Draft — if still testing; Active — when fully ready.
6Set Document Type: Doc, PDF, or Any.
7Click Publish Template (new template) or Update Template (existing template).
8A success confirmation appears — your template is now saved in Salesforce.
Note: When you click “Update Template”, a new version of the template file is created. Previous versions are preserved in the Preview Attached Files component on the template record page.

Tag Syntax Quick Reference

Tip: You do not have to use the add-in for every tag. Type these tags directly into your Word document. Use straight quotes (“) — not Word’s curly smart quotes. Use the Preview tab to verify manually typed tags.

Basic Field Tags

TagExampleDescription
<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

TagExampleDescription
<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

TagDescription
<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

TagExampleDescription
<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

TagDescription
<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

TagDescription
<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

ProblemLikely CauseSolution
Error: “Field not found”The field was renamed or deleted in SalesforceRe-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 beThat field is empty on the selected recordTry a different record that has data in that field
Insert button does nothingNo cursor position set in WordClick inside the Word document to position your cursor, then click Insert again
Login fails or authentication errorOAuth or External Client App misconfigurationContact your Salesforce administrator
Template doesn’t appear in the listingWrong environment or template is DraftCheck you are signed into the correct environment. Set Status to Active
Smart quote error in tagWord autocorrected quotes to curly/smart quotesReplace curly quotes with straight quotes in the tag
Image shows as broken/missingThe image field is empty or invalidVerify the field value exists and contains a valid image in Salesforce
Sum total shows 0 or wrong valueWrong field API name in sumBy tag (case-sensitive)Use the exact Salesforce API field name
Template saves but users cannot find itStatus is still set to DraftGo to the Live tab, change Status to Active, and click Save again
View/Loop shows no recordsThe selected record has no child recordsTest with a different record that has data in the related list
Condition always shows or always hidesCondition logic is inverted or wrong valueCheck the field value in the actual Salesforce record
My preview edits disappearedEdits made in Preview mode are not savedMake changes in the CREATE tab, then re-preview
360 InstantDocs — Word Add-In User Guide • Version 1.0
© 2026 360 InstantDocs. All rights reserved.
Explore Other Articles
logo Live Chat