Skip to content

Conditionals

Conditionals help us to make decisions in our code. Conditionals are executed using Boolean expressions.

Structure

yml
if: # Boolean expression
then: # Array of sequences
else: # Array of sequences (Optional)
FieldTypeDescriptionRequired
ifstringThe Boolean expression to be evaluated.
thenstringAn array of sequences that will be executed if the boolean expression is true.
elsestringAn array of sequences that will be executed if the boolean expression is false.

Boolean Expressions

Boolean expressions are composed using the following format:

yml
variable operator value

Example of a Boolean Expression

yml
if: "[user_id] eq '945029082314338407'"

Variables

List of Available Variables

You can find a list of available variables in the Variables page.

Operators

List of Available Operators

You can find a list of available operators in the Operators page.

Values

Using Variables or Literal Values

Values can support variables or literal values.

Using Variables

When variables are used as values, the variable can be set as seen in the Variables page.

Example of Variables

yml
if: "[user_id] eq [owner_id]"

Use of Single Quotation Marks

When using variables, single quotes must be omitted. If they are included, the value will be interpreted as a Literal Value.

Using Literal Values

When literal values are used as values, the value must be wrapped inside single quotes (').

Example of Literal Values

yml
if: "[user_id] eq '945029082314338407'"

if: "[user_id] eq 945029082314338407" # Both single quotation marks are missing
if: "[user_id] eq '945029082314338407" # A single quotation mark is missing at the end
if: "[user_id] eq 945029082314338407'" # A single quotation mark is missing at the beginning

Use of Single Quotation Marks

When variables are used, single quotes are mandatory. If they are not included, an error will be returned.