Conditionals
Conditionals help us to make decisions in our code. Conditionals are executed using Boolean expressions.
Structure
if: # Boolean expression
then: # Array of sequences
else: # Array of sequences (Optional)
Field | Type | Description | Required |
---|---|---|---|
if | string | The Boolean expression to be evaluated. | ✅ |
then | string | An array of sequences that will be executed if the boolean expression is true. | ✅ |
else | string | An array of sequences that will be executed if the boolean expression is false. | ❌ |
Boolean Expressions
Boolean expressions are composed using the following format:
variable operator value
Example of a Boolean Expression
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
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
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.