The Condition block

Condition block

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.

Inputs

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 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.

Add data blocks

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 Add condition to add another Condition field.

Outputs

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.

Setup

  1. To receive and evaluate data from another block in your flow, connect the variable input port to the other block's output port.

  2. To embed a block and evaluate its data, select Add data blocks 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.

  3. Select the dropdown list next to the block's title and select FQL or TypeScript.

  4. Enter your FQL or TypeScript expression in the text box.

  5. (Optional) Select Add condition 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