Use Add Condition to setup a condition for the action to execute. And only execute if the condition is met.
The Condition pop up has three fields.
(a) Use the first field to select the output variable of any of the previous actions on the Context Variable pop up.
(b) Use the dropdown under Rules on the Condition pop up to select any one of the different types of condition available.
Different conditions based on data types:
Contains — String (ABC)
Doesn’t contain — String (ABC)
Starts with — String (ABC)
Doesn’t start with — String (ABC)
Ends with — String (ABC)
Doesn’t end with — String (ABC)
Equals — All data types
Does not equal — All data types
Greater Than — Number (123)
Less Than — Number (123)
Is True — Boolean
Is False — Boolean
You can see the corresponding data type beside the output on the Context Variable pop up.
You can further specify the conditions for each data type separately as
1. ABC (String)
2. 123 (Number)
3. T/F (Boolean)
(c) Based on the first 2 fields under Rules, you can set up the third field to complete the entire condition set up.
If the second field is a string or a number, you will get the third field. Consider the following example:
You can check if an email contains a specific patter by choosing the User Email output from a previous action and selecting Contains on the dropdown and then specifying the pattern to be checked for as follows:
(1) User Email → (2) Contains → (3) firstname.lastname@example.org
For Instance, if the second field is Boolean (true/false) you won’t get the third field. For this, consider the following example:
You can check if sending an OTP to a mobile number was a success by selecting the Send OTP Success output variable from a previous action and then, Selecting Is True on the dropdown. The third field is will be disabled. It goes like this:
(1) Send OTP Success → (2) Is True
Note: You can add any number of conditions on the Condition pop up using the following logic operators:
- And — Used to specify that conditions involved must get verified to perform an action.
- Or — Used to specify that verification of any one of the conditions is enough to perform an action.
Based on how you setup a condition, a summary of the condition will be displayed under the condition summary field. You won’t be able to edit the summary though.