Long IFs
When building an IF statement in a Template you need to use single quotes around the evaluator of the condition you are testing for. In this example we are testing to see if the Field Question_yn is true:
{ MERGEFIELD IfStart:1 Question_yn = 'true' } CONDITIONAL TEXT { MERGEFIELD IfEnd:1 }
If the evaluator ‘true’ is surrounded by double-quotes (i.e. “true”) this it will not evaluate.
Short IFs
However, just to confuse things, when you are using a Short-IF statement, you need to use double-quotes!
{ IF "{MERGEFIELD Question_yn }" = "true" "Put this text in" "Otherwise put this text in" }
Or, if the data being evaluated is numerical:
{ IF {MERGEFIELD Number_num } = 1 "Put this text in" "Otherwise put this text in" }
For further information see our article on Short IF statements.
Comments
0 comments
Article is closed for comments.