Copy link to clipboard
Copied
A coworker just asked this so I thought I'd share. The general form of a condition in Document Generation looks like so:
{% conditional-section expr(state = "LA") %}
La yes
{% end-section %}
If you want to evaluate to true based on 2 or more possible matches, use "OR":
{% conditional-section expr(state = "LA" or state = "PA") %}
La or PA yes
{% end-section %}
As an aside, this coworker specifically was asking about checking -43- values. Now, while I believe 43 clauses should work fine, it's going to be pretty ugly in your Word template. In this scenario, I'd preprocess your data. So before you call the API, look at your data, and in your code, set some _new_ property, like "inSpecial43States" to true or false based on your logic. Then your Word document will be much cleaner (and easier to understand too).
Have something to add?