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.
variable
- Connect a block to this input port to evaluate its data with FQL or TypeScript. Select the 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.
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
to evaluate their data.
Connect the
Data
input port to the block sending the data you want to send from the
THEN
or
ELSE
output port.
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.
(Optional) If you're using FQL, select the
Snippets
dropdown list and choose a predefined query.