---
schema_version: "1"
id: 9b6998fd16fa57aed6933187537ad61bdbfcbb0cb8bbde0cad65b0431bcd820b
title: Mail Merge Examples
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/admin_files_quip_templates.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.admin_files_quip_templates.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 002205e6dd07a5db71bdca2f83142b4e01de564167b1354a30d7a25e2ceaa612
description: Use templates to prepopulate documents with content that’s specific to the Salesforce record they’re embedded in. For example, you want to use a document to store an Account Plan for each account. When a user creates an Account Plan, you want it to include the same boilerplate content for every account. But you also want to include specific field values from the account, such as the account name and description.
products:
  - Quip
  - Cross Cloud
release: "264"
---
# Mail Merge Examples

Use templates to prepopulate documents with content that’s specific to the Salesforce record they’re embedded in. For example, you want to use a document to store an Account Plan for each account. When a user creates an Account Plan, you want it to include the same boilerplate content for every account. But you also want to include specific field values from the account, such as the account name and description.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr></tbody></table>

Quip supports basic mail merge syntax for auto-filling data from Salesforce records. This syntax supports standard and custom fields that are directly on the Salesforce object, and lookup fields up to one level. You can use any document as a template—nothing special is required. For the best templating experience, use the template format to [create a template](https://help.salesforce.com/s/articleView?id=xcloud.quip_create_template.htm&release=264.0.0&type=5 "Use the template format to safely create and share a template in Quip.") or [mark a document as a template](https://help.salesforce.com/s/articleView?id=xcloud.quip_mark_as_template.htm&release=264.0.0&type=5 "To differentiate documents that your team uses as templates, mark your documents as templates in Quip. See what documents are embedded in Salesforce based on the object, convert your embedded documents to templates, and access them from the Template Library in Quip.").

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_tip.png)

Tip

Use Object Manager to determine the names of the fields of your Salesforce object. Click the gear icon, select **Edit Object**, and click **Field & Relationships** on the left.

## Standard Fields

To include the value of a standard field of an object in a Quip template, use this syntax:

```
[[objectname.fieldname]]
```

This example pulls data from the standard Description field of the Account standard object.

```
[[Account.Description]]
```

## Standard Lookup Fields

To include standard lookup fields, use this syntax:

```
[[objectname.lookupfieldname.referencefieldname]]
```

For example, the Contact standard object has an AccountId lookup field that references the Account standard object. This example pulls the Account name into a template that you’re embedding in the Contact object.

```
[[Contact.Account.Name]]
```

## Custom Lookup Fields

If your record doesn’t have a standard field that links it to another record, such as \[\[Account.Contact.Name\]\], create a custom lookup field. Make sure that you use the correct field name, which usually has `__c` at the end. This example uses a lookup field in Accounts to pull in Contacts associated with this Account.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_example.png)

Example `Contact__c` is a custom Contact lookup field.

![Contact\_\_c custom lookup field in Object Manager](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_contact_custom_lookup.png)

To add name of a Contact related to an Account, enter `[[Account.Contact__r.Name`. The `__c` is replaced with an `__r` in the mail merge syntax.

![Account Plan template with mail merge fields highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_doc.png)

![Mail merge fields populated by record](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_generated_doc.png)

The field must be exposed in the user interface and populated with a Contact for the mail merge to work.

![Contact field is filled out on the record](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_lex_contact.png)

## Custom Reference Fields

To include custom reference fields, use this syntax:

```
[[objectname.lookupfieldname__r.customfield__c]]
```

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_example.png)

Example

To use mail merge to pull a Contact’s days since last activity as it relates to an Account, use `[[Account.Contact__r.Days_Since_Last_Activity__c]]`.

![mail merge fields highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_lookup_reference.png)

![Mail merge fields populated by record](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_generated_doc.png)

## Images

To use mail merge syntax to add an image to a template, like a logo, use a formula field in Salesforce. You can pull in an image URL field into the formula, or add the image URL directly. Images can’t be resized.

In a template, use `[[ObjectName.CustomImageField__c]]` where CustomImageField\_\_c is a formula field of type text.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_example.png)

Example

`Image__c` is a custom formula field of type text on the Account object. To add a Quip logo to the formula, use `IMAGE("https://symbols.radicasoftware.com/93/brands-qa-qz/19/quip", "Quip", 300, 300)`. If you have a separate Image URL field for the logo, use `IMAGE(ImageURL__c, "Quip", 300, 300)`.

![Formula highlighted in for image custom field](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_image.png)

In a template, enter the mail merge field \[\[Account.Image\_\_c\]\].

![\[\[Account.Image\_\_c\]\] highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_mail_merge_image_field.png)

## Default States

To add a user-friendly mail merge state to your templates if the mail merge field doesn’t match the Salesforce record field, add a default state in single or double straight or curly (smart) quotes. If the mail merge field matches a Salesforce record field, the default state doesn’t show.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_example.png)

Example

To replace mail merge syntax with "Account Owner Phone Number Default" when the field doesn’t exist in Salesforce, enter \[\[Account.Owner.PhoneNumber, "Account Owner Phone Number Default"\]\].

## Template Tips and Considerations

- When you reference a field in your template, use its field name. Don’t use its field label. Object Manager displays both values.
    
    ![Edit an object.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/admin_files_quip_om_field_name.png)
- The document is auto-filled based on data at the time of its creation. When data changes occur, the document doesn’t automatically update.
- You can have up to 250 fields, with no more than 20 lookup fields.
- Mail merge defaults don’t support smart, or curly, quotes. To include a mail merge default state, use straight quotes.

## Sample Templates

Here are some sample templates to help you get started with your own.

- [Account Planning Template](https://corp.quip.com/CfKLAYnHvqCs?template=1)
- [Territory Planning Template](https://corp.quip.com/qLd7Ai31apBU?template=1)
- [Account Transitions Template](https://corp.quip.com/PcHTAD0NkMnb?template=1)
- [Call Plans Template](https://corp.quip.com/4hTOAHNpYCTQ?template=1)
- [Customer Success Plans Template](https://corp.quip.com/eArtA8EqBNiC?template=1)
- [Customer/Partner Matrix Template](https://corp.quip.com/tUaaAqrk1aqG?template=1)
- [Swarm Room Template](https://salesforce.quip.com/iDsaAARIe5QP?template=1)
- [Root Cause Analysis Template](https://salesforce.quip.com/7Z0eAdtYesvr?template=1)
- [Service Manager Performance Review Template](https://salesforce.quip.com/PmAKALyP76Y4?template=1)
- [Tier 3 Case Escalation Template](https://salesforce.quip.com/hMvgAFXIawe7?template=1)