Skip to main content

Tags in DOCX documents (basics)

Y
Written by Yuliia Biletska
Updated over 2 months ago

What are tags used for?

WorkFlow document generation tags are tools that allow you to automatically create and populate document content.

Use tags to:

  • Create merge fields

  • Insert images

  • Add tables with a dynamic number of rows

  • Show or hide text paragraphs based on conditions

  • Insert a list of items

  • Insert HTML content

How to add tags?

Tags are included in figure brackets - {{TagName}}


Use Tag Generator to generate merge tag syntax automatically. Then, just copy & paste the tag syntax into your document.

Note: You can name your tags anyway you like. There is no required naming convention. Just make sure you give your tags descriptive names so that you can easily identify them when mapping fields with bots.

How to populate tags?

Use pre-fill bots to populate your tags with content from external sources such as Salesforce, MS Dynamics 365, NetSuite, Google Sheets, MS Excel 365, Airtable, Smartsheet, MySQL, and many others. You can use multiple data sources to generate documents.


For example, you can grab a section of data from your Salesforce records, another section of data from NetSuite records, and generate documents that contain both sections of data.

When configuring pre-fill bots for DOCX documents, you can select the type of data to map - Single line or Table:

  • If Single line is selected, the field tags should look as follows:

{{Account_name}} , allows using numbers and underscores.

  • If Table is selected, the field tags from document, like

{{for(Product)}}{{Name}}{{endfor}} should look as follows:

{{Product[].Name}}

Types of tags

There are different types of tags that can be used for specific purposes. The following are the tag types along with examples of their usage:

Type

Example

Usage

Merge tag

{{TagName}}

Use this tag to insert a merge field.

Merge tag names don't need to be unique - if you add multiple merge fields with the same name, every field will be populated with the same data. Generate merge tags via the Tag Generator in the online editor, or add them manually to your documents. When the documents are generated, merge tags are pre-filled with specific data that cannot be edited by users.

For tag

{{for(ListName)}}

List Element Field1:

{{ListField1}}

{{endfor}}

Use this tag to insert a list of items. This tag’s name should be unique per document. Be sure to select the Table per the type of data you intend to pre-fill in the lists.

Table tag

{{table(tableName)}}

{{ColumnField1}}

{{ColumnField2}}

{{endtable}}

Use this tag to insert a table with a dynamic number of rows. This tag’s name should be unique per document.

IF tag: Condition depending on variable or field value

{{if(ConditionFieldName=‘Value1’)}}

Output 1

{{else(ConditionFieldName=‘Value2’)}}

Output 2

{{endif}}

Use this tag to add conditional logic in your documents. With this tag, you can show or hide paragraphs of text depending on conditions. This tag’s name should be unique per document.

{{if(ConditionFieldName=‘Value1’ && ConditionFieldName=‘Value2’)}}

Condition 1 and Condition 2

{{endif}}

Use the “and” operator && to add multiple conditions in the IF functions where all logic conditions will be met.

{{if(ConditionFieldName=‘Value1’ || ConditionFieldName=‘Value2’)}}

Condition 1 or Condition 2

{{endif}}

Use the “or” operator || to add multiple conditions in the IF functions where one of the logic conditions will be met.

{{if(Field != null)}} Field is not empty {{endif}}

Use this syntax to check whether the field value is null.

HTML tag

{{html:FieldName}}

Use this tag to insert HTML-formatted content (for example, from Salesforce Rich Text Field).

Fillable field tag

Refer to the Fillable fields section

If you don't want to drag and drop fillable fields into your document, you can use fillable field tag syntax to create fillable fields.

Image tag

{{for(Array)}}

{{imageFile(ImgField)}}

{{endfor}}

Use this tag to insert PDF/DOCX documents and images in the body of a document (for example, from Salesforce records).

Tags for columns and rows in tables

{{rowIf(ConditionName=‘Value’)}}

And

{{columnIf(ConditionName=‘Value’)}}

Shows table rows or columns only if the conditions match.

Did this answer your question?