...
Overview
The
...
Switch action is an advanced decision-making mechanism that efficiently handles multiple possible outcomes or conditions.
Unlike simple if-else conditions, the Switch action tests a single variable or expression against a predefined set of values. Based on which value matches the variable, the corresponding action is executed.
This method is especially useful when there are numerous possible outcomes, as it avoids repetitive and nested conditions, simplifying the workflow.
It is often used in situations where a workflow must take distinct actions based on user choices, status updates, or other distinct categories of input data.
Let’s explore the screens that follow, after drag-n-drop of Switch action on workflow canvas.
Config
...
After clicking on +
button, following screen for creating switch cases opens up.
...
Condition | Description | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Destination Type | It defines the target location, where the decision switch condition will be mapped with. Note: By default, the Destination Type is model. Other options include variable, cookie key, and local storage key.
| |||||||||||
Model | When you select Note:
| |||||||||||
Field | It defines the exact field or variable where values will be stored for mapping. Note:
| |||||||||||
Note: The following fields, namely Operator, Source Type, and Value, are disabled until you fill in the above 3 condition fields. | ||||||||||||
Operator | It is specifically operator value such as Equals, Not Equals, In, Starts With, Ends With, Contains. | |||||||||||
Source Type | It defines the data which will be mapped for decision switch with destination field chosen earlier. Note: By default, the Source Type is Static. Other options include Model, Variable, Cookie Key, Local Storage Key, User, Null, and Blank.
| |||||||||||
Value | The available options will change depending on the selected source type.
|
...
Include Page | ||||
---|---|---|---|---|
|
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
For example, if a sales organization wants to assign leads to different sales representatives based on the lead source, they can use workflow here, suppose there are two sales reps namely |