Mail Merge Conditional Logic Not Rendering Correctly in Exports

Carmen Santos
Carmen Santos
  • Updated
Products and Versions Covered: 
  • Cloud/CVC
  • Self-hosted, Replicated - KOTS

Summary

When exporting Office Templates that use conditional logic (such as { IF } statements), the generated document may not render field values correctly if the source text contains double quotation marks (").

In these situations, the mail merge engine may incorrectly parse the conditional expression, which can cause the exported document to display incomplete text or ignore parts of the template logic.

This behavior occurs due to a limitation of the Microsoft Word mail merge engine used during document generation. When conditional statements evaluate field values that contain double quotation marks, the engine may interpret the quotation marks as part of the conditional syntax rather than as literal characters in the text.

Because this behavior originates from the underlying document processing engine, Jama Connect cannot override or modify how the conditional fields are interpreted during export.

Resolution

Alternative when facing syntax issues in field values

Syntax conflicts may occur when field values contain characters that interfere with conditional logic, such as double quotation marks.

When creating or updating field content that will be used in document generation with conditional logic, avoid using double quotation marks ("). Using single quotation marks (') helps ensure the mail merge engine processes the template structure correctly.

Alternatively, update the text stored in Jama fields by replacing double quotation marks (") with single quotation marks ('). This prevents the mail merge engine from misinterpreting the characters when evaluating conditional logic in the template.

Identify affected items

Create a filter in Jama Connect to locate fields that contain double quotation marks. Review the results and update the affected fields as needed.

Avoid using unsupported fields in conditional statements

Text boxes and rich text boxes may contain special characters or formatting that the mail merge engine does not support when evaluating IF statements.

Consider using text fields instead when conditional logic is required in the template.

Consider alternative reporting options for complex documents

If the document requires more advanced logic, formatting, or data handling than Office Templates support, consider using Velocity-based reports. Velocity reports provide greater flexibility and control when generating more complex or structured reports.

Additional Resources 

Feedback:
We welcome your input! Please sign in to leave any comments, suggestions, or improvement ideas below.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.