If Conditional and Math Tags

Have more questions? Submit a request

 

This article was developed to describe the features associated with Conditional ("If") Tags as well as Math Tags. 

 

Conditional Tags

The CRM has a unique feature that allows you to perform conditional “if statements” in your documents using contact and program information, nested inside of “if” tags. This can allow certain information to populate depending on if the qualifying criteria are true.

These conditional tags can use standard fields, and custom fields, and even be based on Math to detect if a statement is true or not. Use of these statements is paramount when it comes to building document templates, email templates, and even SMS templates, as it can often prevent multiple templates from needing to be created, instead just showing information but only if certain criteria are true.

For example, an “if statement” could be used to call additional paragraphs if the client lives in a specific state, a different page if the client is paying via ACH Debit versus Credit Card, or even differing information depending on the client’s enrolled gateway. Without using conditional tags, all of these example scenarios would instead have required additional templates to be created to accomplish the same thing, which opens the door for user error if the wrong template was selected.

Please see the following table for different kinds of conditional statements and their uses:

Example Conditional Tags ("IF" statements)

{if '{CF:Favorite Color}' = 'Red'}X{endif}

Populates "X" if the Favorite Color field is Red

{if '{CF:Favorite Color}' != 'Red'}X{endif}

Populates "X" if the Favorite Color field isn't Red

{if '{CF:Hardship Description}' ~= 'medical'}X{endif}

Populates "X" if the Hardship Description field includes the word medical

{if '{CF:Hardship Description}' ~== 'Medical'}X{endif}

Populates "X" if the Hardship Description field includes the word Medical (Case Sensitive)

{if '{CF:Hardship Description}' !~= 'medical'}X{endif}

Populates "X" if the Hardship Description field doesn't include the word medical

{if '{NUMDEBTS}' > '13'}14{endif}

Populates "14" if the number of enrolled debts is greater than 13

{if '{NUMDEBTS}' < '13'}12{endif}

Populates "12" if the number of enrolled debts is less than 13

{if '{CF:Holiday}' = 'Yes' && '{CF:Business Day}' = 'Yes'}X{endif}

Populates "X" if the Holiday field is Yes and the Business Day field is Yes

{if '{CF:Holiday}' = 'Yes' || '{CF:Business Day}' = 'Yes'}X{endif}

Populates "X" if the Holiday field is Yes or the Business Day field is Yes

{if '{CF:Favorite Color}' = 'Red'}X{else}Y{endif}

Populates "X" if the Favorite Color field is Red, otherwise populates "Y"

{if'{STATE}' = 'state_abbrev'} X {else} {if'{STATE}' = 'state_abbrev'} X {else} Y {endif} {endif}

Populates "X" pending on what STATE equals to, otherwise populates "Y".

Number of (endif) must equal number of IFs. Intended for multiples of similar parameters that have different X result but share similar Y result.

 

NOTE: Whenever you are using If conditional statements, be sure to end every if with matching endif (see the table above for examples) or it can cause the information to display incorrectly.

 

Math Tags

The CRM has a unique feature that allows you to perform dynamic math calculations in your documents using contact and program information. These tags are extremely useful for auto-populating data into document templates, email templates, and SMS templates for those who use the SMS platform.

There are 2 types of Math tags that can be used.

{MATH:} - does not round decimals: displays the exact result with decimal places

{MATHR:} - round to 2 decimal places: good for prices or percentages.

{MATHR0:} - removes trailing decimal places

Inside the Math tags, you can place numbers or other tags.

For example, if you wanted to show what the client is currently paying in minimums per month.

Ex: {MATHR: ({TotalDebt} * .03)}

or if you wanted to display the total amount of a fee to the client.

Ex. {MATHR: {TotalDebt} * ({FEE1_PERCENT} / 100)}

NOTE
These tags do not return dollar or any other value sign, so use your dollar signs, etc. outside of the tags like: ${MATHR: **myformula**}

 

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share