IF statement not working – using wrong ‘quotes’ (must use single quotes)

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" }

NOTE: No comma is required between the two alternative texts to be inserted.