Understanding Flow Variables

Updated 21 hours ago by Karan

In this guide, you will understand how to use variables in a flow. The variable is a symbol that functions to hold dynamic values or expressions. The role of a variable may change during the execution of the flow.

Let's get started.

Flow Input Variables

In a flow, we make use of the variables in each node that hold the input value and the output value. The values are transferred from one node to another node with the help of the variables.

Trigger Variables

Every flow starts with a trigger node. Except for Scheduler, all trigger nodes can pass variables to the flow run. These trigger variables can be accessed in any node using the symbol ${input.variableName}. For example, if you pass tableName field in the Form submission trigger, it can be accessed in any node using ${input.tableName}

Node Output Variables

A flow consists of several nodes. Each node produces output after the execution. This output can be used in the downstream nodes using the notation: ${<nodeId>.output.<field>}.

You don't have to remember to use this notation because alternatively, you can also use the select variables tool.

Select variables tool

If you don't know how to write the request notation, then follow the below-mentioned steps to use the Select Variables Tool. To launch this tool, you will need to click on the ‘Select Variable Tool’ button appearing next to the field in which you need to input the variables.  

To help you understand how the Select Variable Tool feature works, we have configured the ‘Airtable - Update Records’ node below.

Step 1: Hit the ‘Select Variable Tool’ button appearing right next to the Airtable Base ID field.

Step 2: A modal window will appear.  

Step 3: By default, you will see the ‘Output Values’ tab. However, the ‘Select Variable Tool’ button has three tabs, illustrated below:

  • Input Tab - allows you to provide your flow with input values.  
  • Output Tab - contains the output from the node that comes before the node you are configuring.  
  • Functions Tab - contains the functions that you can use to perform a specific action. 

You can select the field you want. You can also click on the expand/collapse arrow button appearing beside the field to open/close the field. 

Functions Tab 

The functions tab contains all the functions that a user can use. Follow the steps mentioned below to use a function. 

Step 1: Select the field you want to perform a function on. Here we are performing a ‘datetime’ function to convert input data to ‘datetime’ format. 

Step 2: Click on the ‘Select Variable Tool’ button to select the functions tab. 

Step 3: Select the function you want to apply. Here we are selecting datetime function. 

Step 4: The function will convert the variable into the date & time format. 

Auto-complete feature

The auto-complete function helps users autocomplete the value of their input if they know the field name. It works for an input value, output value, and even functions. 

Moreover, when you start typing and don’t need the auto-completed option, simply click on the Show all options and select the desired value from the Select Variable Tools dialog box. 

Example 

Let’s understand the variables in a flow with an example. 

The flow consists of the Form Submission Trigger node ---> Simple HTTP node ---> Send email node. 

In the submission trigger node, the values entered in the form are stored in a variable as input. Assume that an id is specified by the form on the frontend. 

Now, this id can be used in the Simple HTTP node URL like  https://jsonplaceholder.typicode.com/posts/1 that requests the server to retrieve or send the data. 

And in the Send Email node, the body is used to send the email to the end-user. To send the email, enter email like abc@gmail.com, enter the subject like id, and enter body like the id is ${xmgi.output.response}, where xmgi is the node ID of the Simple HTTP node. Select variables tool can be used to get the node ID.

Finally, the user will get the desired output through the mail. The output email will appear like this: 

Thus the variable store and transfers dynamic values across the nodes in the flow.


How did we do?