Mapping Data by Using if/else
Conditions
The if/else
statements are used to execute blocks of code based on the specified conditions.
if (condition1)
{
// execute this block of code
}
else if (condition2)
{
// execute this block of code if the previous condition fails
}
else
{
// execute this block of code if all conditions fail
}
You can add conditions in your data mappings to get outputs based on those conditions. You can add conditions to primitive objects, nested arrays, nested objects, and any other type of input. if/else
conditions are available in activities and triggers in the main flow and error handler.
To Map Data Using Conditions
- Procedure
-
Click the ellipsis icon
to open the menu of the element to which you want to add the conditions. Select Add Condition. An
If
condition is added to the element. -
In the text editor of the
If
condition, enter an expression whose result evaluates to a Boolean value. You can enter the expression manually or map data from the Available data pane. If children elements exist, you can enter values for them. -
To add an
Else-if
or anElse
condition, click the ellipsis iconto open the menu of the element with the
If
condition. Click Add Else-If or Add Else.
Considerations when using conditions:
-
For one
If
condition, you can add multipleElse-if
conditions and oneElse
condition. -
You can add an
Else
condition only from an element with anIf
condition. -
You can add an
Else-if
condition from anIf
condition and from anElse-if
condition.
Deleting a Condition
Click the ellipsis icon to open the menu of the condition that you want to delete. Click Delete.

To delete an If
condition that has Else-if
and Else
conditions:
You cannot directly delete an If
condition that has Else-if
and Else
conditions. You must first delete the Else-if
and Else
conditions to delete the parent If
condition.
In the following example, to delete the If
condition on Character, you must delete the Else-if
and Else
conditions.
