You are here:
Tokens in Microsoft Word or Microsoft PowerPoint Documents
You can insert multiple types of tokens in a Microsoft Word or Microsoft PowerPoint document template, such as variables, repeating content, condition evaluation, dynamic images, hyperlinks, and rich text. During document generation, tokens are replaced with actual data in the generated document. To avoid incorrect token replacements, use unique token names for each object level. If both parent and child objects use the same token name (for example, {{IMG_image1}}, and the child token is empty, the system may insert the parent’s value into the child section during document generation.
Token Category |
Token Notation |
Description |
|---|---|---|
Variable token |
{{token_name}} |
Shows the value of a variable that is passed into the document template as a JSON element. The displayed value uses the formatting of the first curly brace. For example, if the first curly brace in the token is italicized, the text in the token is italicized as well. New lines within variable tokens in the generated document aren't supported. Formatting present in content merged via variable tokens will be disregarded upon token replacement during document generation. This includes any formatting such as bold, italics, new lines (\n) and carriage returns (\r). For example, if content containing \n is sourced from a plain text field, the resulting document won't render the token contents on separate lines; instead, they’ll appear on a single-line . To retain formatting in the generated document, use rich text fields in the objects and RTB tokens in the document templates. See add a text watermark to a document template to add watermarks on your generated document by using variable tokens. |
Repeating content token |
{{#token_name}} <Content to repeat> {{/token_name}} AND {{^token_name}} <Content to display> {{/token_name}} |
Repeats a content section. A token beginning with the pound sign (#) indicates that the section repeats as many times as the item occurs in the input JSON array. A token beginning with the caret (^) indicates what is shown if the input JSON array is empty or doesn’t exist. In this case, the section is shown only one time. The token itself isn’t shown and values don’t use the token text formatting. |
Condition evaluation token |
{{#IF_token_name}} <Content to display> {{/IF_token_name}} AND {{^IF_token_name}} <Content to display> {{/IF_token_name}} |
Checks a Boolean condition to show a section one time or not to display the section at all. If the value of a token beginning with If the value of a token beginning with The token name from your Omnistudio Data Mapper or Apex and the token name in your document template must both contain IF_ as a prefix. An example is for the condition token {{^IF_token_name}}, where the token name from your Data Mapper or Apex is IF_resident and the token in the document template is {{^IF_resident}}. The shown values don’t use the token text formatting. |
Image token |
{{IMG_<imagetokenname>}} |
By using image tokens in a Microsoft Word or Microsoft PowerPoint document templates, you can insert dynamic images in the generated .docx and .pdf files. The image token must start with IMG_. The format is {{IMG_<magetokenname>}}, for example, {{IMG_header}}. Salesforce supports the use of a single image, multiple images, and loop images. |
Hyperlink token |
{{HYP_<hyperlinktokenname>}} |
By using hyperlink tokens in a Microsoft Word or Microsoft PowerPoint document templates, you can insert dynamic URLs in the generated .docx and .pdf files. The hyperlink token must start with HYP_. The token format is {{HYP_<hyperlinktokenname>}}, for example, {{HYP_Salesforce Website}}. |
Rich text token |
{{RTB_<richtexttokenname>}} |
By using rich text tokens in a Microsoft Word document template, you can insert rich text content in the generated .docx and .pdf files. The rich text token must start with RTB_. The token format is {{RTB_<richtexttokenname>}}, for example, {{RTB_HeaderRichText}}. If you must use rich text with images, use the RTB_token instead of the IMG_token. |
| Data True-up token | {{DT_ContractTerm}} | By using Data True-Up tokens in DOCX templates, you can view and sync field values between the generated .docx document and the associated Salesforce record. These tokens enable side-by-side comparison of values and support updating either the document or the record directly from the Microsoft 365 Word add-in. A Data True-Up token must start with DT_. The format is {{DT_<FieldName>}}, for example, {{DT_ContractTerm}}. Salesforce supports syncing for tokens on standard or custom parent-level objects. You can pull the latest field values from Salesforce into the document or push updated document values back to the record to maintain consistency. |
| Bypass Token | bypass_tokens | Use bypass_tokensto retain token text in the generated document when no value is available. By default, tokens without data resolve to empty values, which can remove placeholders required for downstream workflows. When you include a token name in bypass_tokens, document generation keeps that token unchanged in its original notation in the document, such as {{Sig_es_:signer1:signature}}. This behavior is useful for preserving e-signature tags or other placeholders that must remain for external processing. If a value is provided for a listed token, the value replaces the token. Tokens not included in the list continue to resolve to empty values when no data is available. Enter the token name without curly braces ({{ }}) and
specify values in bypass_tokens by using a comma-separated format. For example,
include the token |
Condition Evaluation Tokens
A condition evaluation token shows a section one time or doesn't show it, depending on the Boolean values true and false.
The value that is passed to a condition evaluation token must be Boolean. If a string or a number is passed in, the condition evaluates as true, which leads to unexpected behavior. Pass only a Boolean value to a condition evaluation token.
-
If the value of a token beginning with
#IF_is true, the section appears one time, otherwise it doesn't appear. -
If the value of a token beginning with
^IF_is true, the section doesn't appear, otherwise it appears one time.
A condition evaluation token begins with {{#IF_token}} or {{^IF_token}} and ends with {{/IF_token}}.
The condition is evaluated in a formula in the transform Data Mapper attached to the document template.
The syntax #IF_ and ^IF_ have special meaning during token extraction. #IF_ and ^IF_ are regular variables, and not an array.
Condition Evaluation Token Example
Data Mapper Formula:
IF(Contact:MailingCountry != 'US', IF(Contact:MailingCountry != 'United States', true, false), false)
Data Mapper Formula Result Path:
IF_customer_not_in_US
Microsoft Word Content:
{{#IF_customer_not_in_US}}
2. US Export Compliance
The Services that Telecom makes available, and any derivatives thereof, may be subject to export laws of the United States and other jurisdictions. Each party represents that it isn’t named on any US Department of Commerce-Denied Person's List or Entity List. The Telecom Services, or any derivatives thereof, may not be exported to or used by: (i) any US embargoed countries; or (ii) anyone on the US Treasury Department's list of Specially Designated Nationals or the US Department of Commerce Denied Person's List or Entity List. Subscriber agrees to comply with all applicable laws regarding the transmission of technical data exported from the United States and the country in which the subscriber's customers or end-users are located.
{{/IF_customer_not_in_US}}
{{^IF_customer_not_in_US}}
3. Arbitration
Any dispute or controversy arising under or in connection with this Agreement shall be settled exclusively by arbitration in accordance with the rules of the American Arbitration Association then in effect. Judgment may be entered on the arbitrator's award in any court having jurisdiction.
{{/IF_customer_not_in_US}}
4. Fees
Fees. You’ll pay all fees specified in Order Forms. Except as otherwise specified herein or in an Order Form, (i) fees are based on Services and Content subscriptions purchased and not actual usage, (ii) payment obligations are non-cancelable and fees paid are non-refundable, and (iii) quantities purchased can’t be decreased during the relevant subscription term.
The customer_not_in_US value is false.
2. Arbitration
Any dispute or controversy arising under or in connection with this Agreement shall be settled exclusively by arbitration in accordance with the rules of the American Arbitration Association then in effect. Judgment may be entered on the arbitrator's award in any court having jurisdiction.
3. Fees
Fees. You’ll pay all fees specified in Order Forms. Except as otherwise specified herein or in an Order Form, (i) fees are based on Services and Content subscriptions purchased and not actual usage, (ii) payment obligations are non-cancelable and fees paid are non-refundable, and (iii) quantities purchased can’t be decreased during the relevant subscription term.
- Page Break Behavior with Conditional and Repeating Tokens in Omnistudio Document Generation
Guidelines to prevent blank pages and layout issues when adding page breaks to document templates that include conditional or repeating tokens.

