The Condition block is a logical gate that routes data through one of multiple output ports based on the results of one or more evaluations. It's a useful block for routing your flow according to specific conditions. A single Condition block can do the work of multiple If or Evaluate blocks by evaluating several if-then conditions and routing data based on the result.
You can set up the Condition block to evaluate data using Flows Query Language (FQL) or TypeScript expressions. The Condition block will route the input data through the output port that corresponds to the first satisfied condition.
variable - You can either connect a block to this input port or embed a data block to evaluate the block's data with FQL or TypeScript. Select Add data blocks to embed a data block in your Condition block. You can change an embedded block to a different data block by selecting the embedded block's icon and choosing a block from the dropdown list.
Condition <number> - Enter a true/false expression here using FQL or TypeScript. Select the dropdown list at the top of the block to set the text box to use FQL or TypeScript. Select Add condition to add another Condition field.
The first condition that evaluates to true routes the input data through its output port. For example, if Condition 1 evaluates to false and Condition 2 evaluates to true, the input data is routed through the Condition 2 output port. If no conditions are true, the input data is routed through the Default output port.
To receive and evaluate data from another block in your flow, connect the variable input port to the other block's output port.
To embed a block and evaluate its data, select Add data blocks then select a block from the dropdown list. You can reference the embedded block's value as a variable in your true/false expression. To rename the variable, select the embedded block's name and enter a new name.
Select the dropdown list next to the block's title and select FQL or TypeScript.
Enter your FQL or TypeScript expression in the text box.
(Optional) Select Add condition to add another condition and enter an FQL or TypeScript expression.
You can embed the following blocks in the Condition block to evaluate their data:
Last modified: 2024/11/05