Syntax of conditional functions
To insert a conditional function in the HTML body of one of the supported areas, use the syntax:
{if (conditions)}
Text or HTML to appear if condition is true
{/endif}
If the conditions evaluate to FALSE, then the text or HTML is not shown.
Available conditional functions
This section covers the specific conditional functions supported in alerts, communication templates, Data Showcase, and Query Template Display.
Important! All conditional functions are case sensitive and must be upper case.
COUNT
Counts the number of items in a collection and returns an integer value.
{if (COUNT(#party.AdditionalAttributes) GT 0 AND #party.AdditionalAttributes[1].Name EQ
'IsMemberRecord' AND #party.AdditionalAttributes[1].Value EQ true)}
Is a member.
{/endif}
LENGTH
Determines the length of the value and returns it as an integer.
{if (LENGTH(#query.TAX_EXEMPT) GT 0)}
Contact is tax exempt.
{/endif}
ISTRUE
Tests whether the specified parameter is true.
{if (COUNT(#party.AdditionalAttributes) GT 0 AND #party.AdditionalAttributes[3].Name EQ 'IsMember'
AND ISTRUE(#party.AdditionalAttributes[3].Value))}
Contact is a member.
{/endif}
ISFALSE
Tests whether the specified condition is false.
{if (ISFALSE(#query.IsMember))}
Contact is not a member.
{/endif}
ISNULLOREMPTY
Indicates whether the specified string is null or empty. Returns true if the value parameter is null or an empty string; otherwise, false.
{if (ISNULLOREMPTY(#query.Website))}
Please add your website!
{/endif}
ISNOTNULLOREMPTY
Indicates whether the specified string is not null or empty. Returns true if the value is not null or empty; otherwise, false.
{if (ISNOTNULLOREMPTY(#query.PaidThrough) AND #query.PaidThrough LT Now)}
Contact is not yet expired.
{/endif}
DAYSBETWEEN
Returns the number of days between two dates as an integer value.
{if (DAYSBETWEEN(#query.RenewedThrough, #query.PaidThrough) GT 90)}
Member is due for renewal.
{/endif}
DATE
Makes sure date or literal date value is culture safe.
{if (ISNOTNULL(#query.JoinDate) AND (#query.JoinDate GTE DATE('12/31/2021')))}
2022 MEMBER
{/endif}
CONTAINS
Checks whether a particular sequence of characters is part of a given string. Case is ignored and true or false is returned.
{if (CONTAINS(#query.JoinDate, '2022'))}
New member in 2022.
{/endif}
NOTCONTAINS
Checks whether a particular sequence of characters is not part of a given string. Case is ignored and true or false is returned.
{if (NOTCONTAINS(#query.City, 'Austin'))}
Member is not an Austin resident.
{/endif}
STARTSWITH
Check whether the beginning of the current string instance matches with a specified string or not. Case is ignored and true or false is returned.
{if (STARTSWITH(#query.City, 'Aus') OR STARTSWITH(#query.City, 'Dal') )}
Member may live in Austin or Dallas.
{/endif}
ENDSWITH
Check whether the end of the current string instance matches with a specified string or not. Case is ignored and true or false is returned.
{if (ENDSWITH(#query.FullName, 'Smith') OR ENDSWITH(#query.FullName, 'Richards') )}
Last name ends with Smith or Richards.
{/endif}