Condition (If)

The If condition statement allows you to specify that a set of actions should only be performed if one or more conditions are met. It also allows you to specify actions to take if the conditions are not met.

The Condition statement is located under Common Statements in the Assets Panel.

After dragging an If statement into the Builder area, you must specify:

  • Properties: The two variables or values two compare. They must both be of the same type.

    You must specify the parameter on the left first.

    You can enter a value or click the placeholder to open the Selector window. You can select a simple variable, a property of a complex variable, or any function or method that does not have input parameters.

  • Operator: The comparison operator, for example Equals or Is Less Than. Which operators are listed depends on the type of the property specified on the left. Some operators require only one property to be specified.

  • Then: Drag functions and methods from the Assets Panel into the Then area to specify the actions to perform if the conditions are met.

  • Else: Drag functions and methods from the Assets Panel into the Else area to specify the actions to perform if the conditions are not met.

For example, this workflow step sets the monthly fee for a customer. If the customer's Age is smaller than 18, the Monthly_Fee is set to 100. Otherwise it is set to 180.

The list of comparison operators displayed depends on the type of values entered into the properties of the If statement. For example, for text values the list of comparison operators includes is empty, matches, and contains. Those options are not available if number values are entered. The table below lists the operators and explains how they are applied to each variable type.

Operator

Text

Number & Decimal

Date/Time

Boolean

equals The two strings are identical and are of same case. The values are equal. Both dates and times are equal. The values are equal.
equals (ignore case)

The two strings are identical. If the only differences are in case, the strings are considered equal.

N/A N/A N/A

Specify Multiple Conditions

You can specify multiple conditions and choose whether to apply AND or OR logic:

  • AND: Perform the specified actions if both conditions are met.

  • OR: Perform the specified actions if at least one of the conditions is met.

Continuing the example above, the workflow below includes a second condition so that the Monthly_Fee will be set to 100 if the customer's Age is lower than 18 OR if the customer's Birthday_Month is equal to the current month.

To add a (sibling) condition:

  1. Click next to the existing condition.

    A sibling condition is displayed.

  2. Choose whether to apply AND or OR logic.

  3. If necessary, click:

    • to add another condition.

    • to delete a condition.

Group Conditions

When specifying more than two conditions, it is often necessary to group conditions to ensure that the AND and OR logic operators are applied correctly and to make the conditions more readable.

Continuing the example above, we will specify that customer's over 18 will only be charged the lower rate during their birthday month on condition that they are not in arrears - if they have an outstanding debt they will be charged the higher rate.

The Monthly_Fee will now be set to 100 if:

  • The customer's Age is lower than 18, or:

  • The customer's Birthday_Month is the same as the current month
    AND 
    The customer's In_Arrears value is False.

The last two conditions must be grouped because customers under 18 must be charged the lower rate even if they are in arrears.

You can create subgroups within a group.

You cannot move conditions between groups.

To create groups of conditions:

  1. Click next to the condition that you want to add to a group.

    A group is created and a new blank condition is added to the group.

  2. Specify the properties of the new condition and select the logic operator to apply to the conditions in the group.

  3. You can ungroup a group if needed.

Copy and Paste Actions

You can copy and paste actions within, and between the following assets:

  • Steps
  • Worklfows
  • User-Defined Functions
  • Transitions
  • Triggers
  • Callout control actions
  • If statements

To copy an action, right-click the action > Copy.

To paste an action, right-click the action Builder > Paste.