Skip to main content
Conditional statements are one of the key control structures in CRMScript. They are used do different tasks based on whether the condition evaluates as true or false. For example, you are taking sign-ups for an event and start a waiting-list when all available seats are taken.

If statement

The definition has 3 parts:
  • keyword if
  • the condition in parentheses, must be a boolean expression
  • 1 or more statements, blocks must be enclosed in curly brackets
You can use both conditional and logical operators. You can also compare with the special values true and false.

If else statement

The definition extends the if statement with 2 more parts:
  • keyword else
  • 1 or more alternative statements, blocks must be enclosed in curly brackets
The alternative statements are run if the preceding condition (the if test) evaluates as false.

Else if statement

The else if statement lets you test multiple conditions in sequence.
  • keyword else if
  • 1 or more alternative statements, blocks must be enclosed in curly brackets
  • It must be preceded by either an if statement or another else if statement.
  • It can optionally be followed by more else if statements or a closing else statement.