Nected Docs
Try Nected For Free
  • 5 min QuickStart Guide
  • Getting Started
    • Introduction
    • Core Concepts
    • Use Cases
    • Tech Architecture
    • FAQs
  • INTEGRATIONS
    • Overview
    • Integrations Libraries
      • PostGres
      • MySQL
      • Oracle
      • MS SQL Server
      • Snowflake
      • MongoDB
      • RedShift
      • REST API
      • Google Sheets
      • Slack
    • Managing Integrations
  • DATASETS
    • Overview
    • Managing Dataset
  • Rules
    • Overview
    • Rule Types
      • SimpleRule
      • DecisionTable
      • Ruleset
      • Rule Chain
    • Rule Conditions
    • Rule Actions
    • Concepts
      • Rule Result
      • Test & Publish Rules
    • Add Input Attributes
      • JSON Input Attributes
      • List Input Attributes
  • Triggers
    • Trigger Rule via API
    • Trigger Rule via WebHook
    • Trigger Workflow via API
    • Trigger Workflow via WebHook
    • Scheduler
    • Rule Response Format
  • Workflow
    • Overview
    • Managing Workflow
    • Add Node
      • Action Nodes
        • Rule Node
        • Workflow Node
        • Custom Code Node
        • Database Node
        • REST API Node
      • Control Nodes
        • Loop Node
        • Delay Node
        • Response Node
        • Set Variables Node
        • Switch Block
    • Test & Publish Workflows
  • CODE AND DATABASE QUERIES
    • JavaScript Editor
    • Formula Editor
    • JSON Editor
    • List Editor
    • Excel-like Function
  • Embedded System
    • White-Labelling
    • Embeddable View
  • Self Hosting
    • Overview
    • Infrastructure Sizing
    • New Installation
      • Docker
      • Kubernetes
        • Set Up Kubernetes Cluster on AWS EKS
    • Additional Configuration
      • High Availability
      • Email Setup Guide
    • Upgrade Nected Version
  • Security
    • API Authentication
      • OAuth as part of Authentication under REST API
    • Role Based Access Control (RBAC)
    • SOC 2 Type 2, GDPR, ISO Compliance
  • Audit
    • Audit Trail
    • Approval Flow
    • Version Control & Rollback
    • Import/Export
  • Management API
    • Audit Log API
    • Global Variable API
  • References
    • Attribute Library
    • Global Variables
    • Pre-Configured Tokens
    • Pre-Configured Operators
    • NULL Value Handling/Behavior
    • Troubleshooting Errors
      • Multiple Tabs/Users Edits
      • Limits in Nected
    • Allowed Status Combinations
    • Environments
    • Usage Widget
    • Gen AI
  • ACCOUNT SETTINGS
    • Workspace Setting
      • Date Format and Timezone Settings
Powered by GitBook
On this page
  • Add the Set Variables Node to the Workflow
  • Updating Existing Variables(New):
  • Pass tokens among fields:
  • Use Set Variable Values in Other Nodes
  • Conclusion
  1. Workflow
  2. Add Node
  3. Control Nodes

Set Variables Node

PreviousResponse NodeNextSwitch Block

Last updated 1 month ago

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:

  1. Add the Set Variables Node:

    1. Open your Nected workflow editor.

  2. 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.

    You will see the following two options available by default when using the node:

    Add Variable: This lets you create a new variable and assign it a value.

    This structure allows for not just setting variables initially, but also dynamically updating them further along the workflow using subsequent Set Variable nodes.

    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.

  3. 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.

  4. 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.

Updating Existing Variables(New):

There may be scenarios where you initially set a variable (e.g., discountPercentage) and later need to update it mid-flow based on new logic or data. This is now supported seamlessly with the enhanced Set Variable node.

To update the value of a previously set variable:

  1. Add a New Set Variable Node at the point in the workflow where the variable needs to be updated.

  2. In the Input Params tab, click on Reset Previous Variables.

  3. You’ll see a list of tokens representing all the variables set in earlier Set Variable nodes. Select the one you want to update.

  4. Enter the new value you want to assign to this variable. This can be a static value, a computed formula, or a token from any previous node.

  5. Save the node. The variable is now updated, and the updated value will be used in all downstream nodes referencing it.

This functionality supports updating a variable multiple times across the workflow, offering finer control and more dynamic logic construction without overwriting all previously declared variables.

Pass tokens among fields:

To maximize the efficiency of the SetVariable Node in your project, you can take advantage of its capability to pass previously stored values. This is achieved by using tokens within the same node, allowing you to seamlessly transfer data from one field to another. By employing this method, you ensure a smoother workflow, reduce errors, and enhance the adaptability of your system. This process not only streamlines information transfer but also contributes to a more organized code structure, ensuring that your variables are consistently up-to-date and easily accessible throughout the node's operations.

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.

Then click on the + icon and select the Set variable node from the list of available nodes.

JSON: To input raw JSON data. For detailed steps, refer to the .

List: To input a list of items, such as numbers, JSON, or any other type. For detailed steps, refer to the .

JS Code: To input a custom JS code's executed value. For detailed steps, refer to the .

Formula: To input the executed value of a Formula. For detailed steps, refer to the .

JSON Editor Documentation
List Editor Documentation
JavaScript Editor Documentation
Formula Editor Documentation