Conditional
Use this action node to perform a conditional action based on the previous step's output.
A conditional action, in the context of programming, refers to an action or set of actions that are executed based on a certain condition or set of conditions. It enables you to make decisions and perform different actions based on the evaluation of those conditions.
Conditional actions have numerous use cases across various domains and programming scenarios. Here are a few common cases for conditional actions:
- User Input Validation: When building interactive applications, you often need to validate user input. Conditional actions can be used to check if the input meets certain criteria or constraints.
- Decision Making: Conditional actions are frequently used to make decisions. Based on certain conditions, you can choose different actions or behaviors.
- Workflow Control: Conditional actions can be used to control the flow of a program's execution. You can use conditions to determine whether to proceed to the next step, repeat a loop, or terminate the program altogether. This is especially useful in tasks involving iterations and loops.
Insert a Conditional node in the workflow editor page and provide the required inputs for the node. Configure the conditional node from the previous output and connect the other two nodes based on the condition that satisfies or fails.
Details needed to set up a Conditional instance in Spot Connect:
Input
Parameter Name | Description | Required |
---|---|---|
pick variable | Previous Step Output | True |
comparison operator | How to evaluate the selected variable | True |
comparison value | What to compare the selected variable to | True |
destination | Next Step If This Rule Is Met | True |
Output
This node does not produce an output. It selects the destination node based on the input condition match.
Action Example
-
From the workflow builder in the left panel, drag and drop the Conditional node on the workflow editor page and click it. Define the conditional by adding a rule.
-
Select the previous step’s output.
-
Select the comparison operation.
-
Set the comparison value that you want to compare it with.
-
Set the destination node if the rule is met.
-
In the workflow panel, click the Conditional node.
-
In the next step, if no rule is satisfied, select Fail[fail_1].
-
After the execution of the workflow above, you can see the output of the node in the Executions page.