Specify a condition and execute different set of actions if true or false.

The If condition action specifies a condition that determines the flow of actions within your workflows. Upon evaluation, if the condition is true, the workflow will proceed down the ‘true’ path, executing a predefined set of actions. If the condition is false, the workflow will follow the ‘false’ path, either executing a different set of actions or skipping a step entirely.

Constructing Conditions

Conditions are constructed through a graphical interface where you can select variables, comparison operators, and values. The supported operators for creating these conditions are:

  • Equals / Does not equal
  • Exists / Does not exist
  • Greater than / Greater than or equal
  • Less than / Less than or equal
  • Contains / Does not contain
  • Starts with / Does not start with
  • Ends with / Does not end with
  • Is of type
  • Matches regex / Does not match regex
  • Length equals

Datatypes

For the left-hand side and right-hand side we support several datatypes including:

  • booleans (true, false)
  • strings
  • numbers
  • dates
  • variables (denoted with double curly braces: {{myVar}})
  • and Null / Undefined (null)

Multiple Conditions and Grouping

Multiple conditions can be evaluated within one action, allowing for complex logical statements. Conditions can be connected with ‘AND’ or ‘OR’ operators, which are interchangeable by clicking on them, to dictate how the conditions relate to each other.

Conditions can be also be grouped to create complex logical structures. Groups can contain nested conditions, which allows for the creation of layered logic statements akin to combining several if statements in traditional coding.

Examples

Playground

Lessons

Learn more about the IF condition, among other things, in the following Fastgen University lessons: