Set Variables Node
The Set Variable node is a fundamental component in workflow design, enabling the setting or updating variable values within the workflow. These variables can then be utilized by other nodes for dynamic data manipulation, enhancing the flexibility and functionality of the workflow.
Add the Set Variables Node to the Workflow
To add the Set variable node, follow the below steps:
Add the Set Variables Node:
Open your Nected workflow editor.
Then click on the + icon and select the Set variable node from the list of available nodes.
Configure the Input Parameters: Next, in the "Input Params" tab inside the node, define the variable types and assign a value within the Set Variable node. Variables set using this node can be dynamically manipulated and utilized by subsequent nodes in the workflow.
There are two ways to add values to these keys: either add static values to the keys or use tokens to fetch the previous node's output values that match the data type as input. The Set Variable node supports the following variable types:
Boolean: For
true/false
values. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.String: For alphanumeric data, such as names or addresses. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
Numeric: For numbers. It could be integers or decimals. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.
Date: For date values without a time component, in the format
YYYY/MM/DD
like this:2024/07/21
. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.DateTime: For date and time values, in the
RFC3339
format like this:2024-08-07T12:46:00+05:30
. You can either add static values or use tokens to fetch the previous node's output values that match the data type as input.JSON: To input raw JSON data. For detailed steps, refer to the JSON Editor Documentation.
List: To input a list of items, such as numbers, JSON, or any other type. For detailed steps, refer to the List Editor Documentation.
JS Code: To input a custom JS code's executed value. For detailed steps, refer to the JavaScript Editor Documentation.
Formula: To input the executed value of a Formula. For detailed steps, refer to the Formula Editor Documentation.
Test the Node Test the node by running the workflow and verifying the values of the variables. Toggle between raw and pretty formats to ensure data integrity and correct formatting.
And then just click on "Save" to save the node.
Now if you want to change the timeout time, then you can do so using the timeout option in the settings tab. The timeout setting controls how long the node should wait for a response before timing out.
Use Set Variable Values in Other Nodes
Variables set in the Set Variables Node can be accessed in other child nodes using tokens. For example, if you set a variable userName
in the Set Variables Node, you can use it in the next node like this {{SetVariable.output.key_4.username}}
.
Conclusion
The Set Variable node empowers users to manage and manipulate data dynamically within workflows, offering support for a variety of variable types. By effectively utilizing the Set Variable node, users can create more versatile and efficient workflows to meet their specific requirements.
Last updated