3.16

@@If

Use @@If when you want content to appear within the template based on a test condition. @@If is suitable for short strings of text within a sentence or paragraph. For larger amounts of text, use @@IncludeIf. Place @@If statements directly in the text you want to substitute out. Any formatting you apply is preserved as long as the formatting includes the @@If itself.

Syntax:

@@If(<test>, <true>, <false>)

Parameters:

<test>

The condition you are testing for. The test can be a token.

When testing on a string (non-numeric value), enclose the data in single quotes. When testing on a number, do not use single quotes.

Use Or and And for testing multiple conditions. Or evaluates to true when any of the conditions are true. And evaluates to true only when all of the conditions are true.

You can use any of the following test conditions

=

equals

<>

does not equal

<

less than (only allowed with numeric data)

>

greater than (only allowed with numeric data)

<true>

The text placed in the document if the test is true. Must be enclosed in single quotes, and may not contain any single quotes or statements, but can include tokens.

<false>

The text placed in the document if the test is false. Must be enclosed in single quotes, and may not contain any single quotes or statements, but can include tokens.

 

Example

@@If(#Terms.SpIsRXCovered = ‘Y’, ‘Prescription drug is covered’, ‘Prescription drug is not covered’)