The If block is a logical gate that routes data through one of two output ports based on the result of an evaluation. It's a useful block for routing data in your flow according to specific conditions.
You can set up the If block to process and evaluate data using Flows Query Language (FQL) or TypeScript expressions. You can then route incoming data through the If block's Then or Else output port.
variable - Connect a block to this input port to evaluate its data with FQL or TypeScript. Select Add data blocks to embed a data block in your If 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.
Text box - Enter FQL or TypeScript code to create true/false expressions here. Select the dropdown list at the top of the block to set the text box to use FQL or TypeScript.
Data - Data received by this input port will be routed through the Then or Else output port depending on the result of the expression in the text box.
Outputs - Incoming data is routed through either the True or False output port depending on the result of the true/false expression in the text box.
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.
(Optional) If you're using FQL, select the Snippets dropdown list and choose a predefined query.
Enter your FQL or TypeScript expression in the text box.
To see the If block in an example flow, check out Flow Snippets: If.
You can embed the following blocks in the If block to evaluate their data:
Last modified: 2024/10/05