The Evaluate block

Evaluate block

The Evaluate block is a powerful tool for manipulating and evaluating data within your Flow. It's ideal for filtering data, conditionally executing parts of your Flow, and integrating complex logic.

Using TypeScript scripts or Flows Query Language (FQL) queries, you can set up the Evaluate block to process data and send the result. The Evaluate block has built-in artificial intelligence (AI) to help you create FQL queries, and pre-defined snippets to help you create TypeScript scripts.

Input

variable - This input port accepts data from another block's output port. When this port is connected to another block, the Evaluate block embeds a Select block and assigns the selected value to a variable named value.

Output

Result - Sends the result of the script or query.

Setup

The Evaluate block can process data it receives from its input ports and embedded data blocks. When you create an Evaluate block, it has one input port next to a variable name. When you connect the input port to another block's output port, the Evaluate block embeds a Select block for the incoming data and creates a variable named value. To rename the variable, select it and enter the new name. You can also change the embedded Select block to a different data block by selecting the Select block's icon View logs icon and choosing a data block from the dropdown list.

You can also embed other data blocks in the Evaluate block to process their data. For example, you could embed a String block in your Evaluate block, name the variable string1, and reference it in your query as {{string1}}.

Select the Add data blocks icon Add data blocks icon to embed a data block in your Evaluate block. You can also change an embedded block to a different data block by selecting the embedded block's icon and choosing a block from the dropdown list.

The Evaluate block has a text box where you can enter TypeScript or FQL code to create scripts and queries. Select the dropdown list at the top of the block to set the text box to use TypeScript or FQL. Then select the text box and enter your code.

When the text box is set to use FQL, you can select the Postbot icon Postbot icon to generate FQL code based on plain-language prompts. To use pre-defined FQL code snippets, select Snippets and choose from a list of common tasks.

Example

To see the Evaluate block in an example Flow, check out Flow Snippets: Evaluate.

You can embed the following blocks in the Evaluate block to process their data:

Last modified: 2024/08/23