Using conditional functions in alerts

Conditional functions perform calculations on properties or a range of properties, only if those properties meet a certain condition. These functions test a given range and determine if the condition is true or false before continuing.

You can use conditional functions with the following:

  • Alerts
  • Communication templates
  • Data Showcase content item
  • Query Template Display content item

Available conditional functions with examples

FunctionDescription
COUNTCounts items in a collection.
LENGTHReturns the length of a value.
ISTRUETests whether a parameter is true.
ISFALSETests whether a condition is false.
ISNULLOREMPTYChecks whether a string is null or empty.
ISNOTNULLOREMPTYChecks whether a string is not null or empty.
DAYSBETWEENReturns the number of days between two dates.
DATEMakes a date or literal date culture-safe.
CONTAINSChecks whether a string contains specified characters. This function is not case sensitive.
NOTCONTAINSChecks whether a string does not contain specified characters.
STARTSWITHChecks whether a string begins with specified characters.
ENDSWITHChecks whether a string ends with specified characters.

Acceptable conditional operators

OperatorDescription
GTGreater than
GTEGreater than or equal to
LTLess than
LTELess than or equal to
EQ or EQUALSEqual to
NEQNot equal to
ANDLogical and
ORLogical or

Symbolic operators such as ==, !=, and || are supported, but the preferred syntax is EQ, NEQ, and OR.

Example: Using the birthday alert to display a message based on the member's age
👍

Example

The association is offering a gift to members and donors on their birthday and is customizing the gifts based on their age. If they are over 25, they will receive a Gold gift, and if they are under 25, they will receive a Silver gift.

Do the following to update the out-of-the-box birthday alert to display a conditional gift based on age:

  1. Go to RiSE > Process automation.
  2. From the search, locate the Contact birthday alert.
  3. Select the Name of the alert to open it for edit.
  4. Click the Alert tab.
  5. Click the HTML tab.
  6. Directly under Today is {#Birthday.FirstName}'s birthday, paste the following:
\{if (#Birthday.CurrentAge) GTE 25\}
    Send them a Gold Gift!
\{/endif\}
\{if (#Birthday.CurrentAge) LTE 25\}
    Send them a Silver Gift!
\{/endif\}

Pasting code

  • Click Save & Exit.
  • The alert displays on the member’s account page on their birthday and conditionally displays a Gold or Silver message based on the age defined in the function defined in the alert.