Published Date: July 2, 2026
Validated: Yes
Audience: Everyone
Products and Versions Covered:
- Jama Connect® version(s)
- Cloud/CVC
- Self-hosted
Summary
Office Templates support advanced mail merge tags beyond basic field insertion — including tables of items, conditional logic, multi-table documents, cross-references, exclusion rules, and local variables. This article covers each technique with syntax and examples. It also covers a key setup step: toggling field codes on to view and edit these tags, and toggling them off before uploading to Jama Connect®.
Resolution
Key things to keep in mind
- Advanced mail merge tags like IF statements will not be visible when field codes are toggled off. To make sure you see all tags, you should select everything (Ctrl+A) and toggle field codes on.
-
Always toggle all field codes off before you upload the template into Jama Connect®. Leaving field codes on may cause unexpected behavior.
Creating a table of items
Use the TableStart:CHILDREN and TableEnd:CHILDREN tags to define a row of data in a table.
General format:
{TableStart:CHILDREN:[ItemType]} [Other Tags] {TableEnd:CHILDREN:[ItemType]}Example: Create a User Needs table showing project ID and user need.
Below are the tags with field codes toggled off:
Note: You cannot include a list of upstream or downstream trace information in this kind of table because use of table tags within a table tag is not allowed. Upstream relationships are retrieved via a TableStart:UPSTREAMRELATIONSHIPS and TableEnd:UPSTREAMRELATIONSHIPS.
Creating a table of items with trace information
The standard TableStart:CHILDREN/TableEnd:CHILDREN approach does not work here, since table tags cannot be used within table tags. Instead, define the table header, then define each row of data individually within TemplateStart/TemplateEnd tags for the item — essentially defining each row as its own table.
Example: Display a table of user needs with a list of downstream items in a single table as shown below:
Below are the tags with the field codes off:
Note:
- If there are no items of that type in the folder, the header appears with no rows underneath.
- This approach is not recommended for documents containing more than one set of items.
Using conditional statements in a mail merge template
Refer to Making your mail merge "intelligent" by using IF fields
General format:
{IF "[Conditional Statement]" "[When True]" "[When False]"}Example — Print "Yes" if the setKey is "UN," otherwise print "No":
{IF "{MERGEFIELD "setKey" \* MERGEFORMAT}" = "UN"" "Yes" "No"}Rules:
- Double quotes MUST surround the conditional statement, the true statement, and the false statement.
- IF fields are not visible when field codes are toggled off.
- Toggle field codes off before uploading to Jama Connect®, or the template will behave unexpectedly.
- You can nest other mail merge tags inside the true and false statements.
Displaying different tables within the same document
Use an IF statement to identify the item type, then define the table using TableStart:CHILDREN/TableEnd:CHILDREN as the true or false action.
Example: A document with both User Needs (UN) and Users (USER), exported into separate tables in the same document.
The user table should look like this:
You will need to have an IF field for each item type as follows: (Field codes are toggled on.)
Displaying Jama export text elsewhere in the document
Use a STYLEREF field in Word.
Example:
- Some text appears in the export that you also wish to display in the header
- Create a custom style and apply it to the source text. This style can also be applied to a mergefield in an office template that will turn into the desired value after export. In this example, the style is called "MyStyle"
Insert a Word field with the following code anywhere you want to see the value:
Excluding items from an export based on field content
Use SKIPIF fields.
Example — Exclude any requirement with a status other than Accepted:
<<TemplateStart:REQ>>
{ SKIPIF "<<workflow_status>>" <> "Accepted" }
<<n>>
<<description>>
<<TemplateEnd:REQ>>Operators available for SKIPIF:
| Operator | Meaning |
|---|---|
| = | Equals |
| <> | Does not equal |
| > | Greater than |
| >= | Greater than or equal to |
| < | Less than |
| <= | Less than or equal to |
Creating local variables in Office Templates
You can create local variables in Word by doing the following
{ SET localClientName { MERGEFIELD ClientName }}The above creates a local variable called localClientName, which can be referenced anywhere in the document by the following:
{ localClientName }Additional Resources
- BetterSolutions - Guide to Fields in Word
- Custom Word Template Easy Start Guide
- Understanding How Mail Merge (Office) Templates Work
- Success Programs
- Success Catalog
- Datasheets
- Request a Solution Offering or Training from the Success Catalog
Feedback:
We welcome your input! Please sign in to leave any comments, suggestions, or ideas for improvement below.
Comments
0 comments
Please sign in to leave a comment.