The If block

If block

The If block is a logical gate that sends data from one of two output ports based on the result of an evaluation. It's a useful block for branching your flow according to specific conditions.

Using TypeScript scripts or Flows Query Language (FQL) queries, you can set up the If block to process and evaluate data provided by data blocks. You can then send incoming data from the If block's THEN or ELSE output port. The If block has built-in artificial intelligence (AI) to help you create FQL queries. See Setup for details.

Inputs

variable - Connect a block to this input port to evaluate its data with FQL or TypeScript. Select the Add data blocks icon Add data blocks icon 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 TypeScript or FQL code to create scripts and queries here. Select the dropdown list at the top of the block to set the text box to use TypeScript or FQL.

Data - Data received by this input port will be sent from the THEN or ELSE output port depending on the result of the TypeScript script or FQL query.

Outputs

Outputs - Sends the information to either the True or False pathway depending on the value of the FQL condition.

Setup

  1. Connect the variable input port to a block providing the data you want to evaluate. Embed data blocks in the If block with the Add data blocks icon Add data blocks icon to evaluate their data.

  2. Connect the Data input port to the block sending the data you want to send from the THEN or ELSE output port.

  3. Select the dropdown list next to the block's title and select FQL or TypeScript. Enter your FQL query or TypeScript script in the text box.

  4. (Optional) If you're using FQL, select the Snippets dropdown list and choose a predefined query.

Example

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/08/23