Global Variables

Global Variables enables you to define global attributes that you can use with any rule & actions on the Nected platform. These are like environment variables that can be set for the entire platform.

You can define the following four types of attributes under Global Variables:

  • Boolean – The true/false or on/off attributes.

  • Numeric – The numeric value attributes, such as discount percentage.

  • String – The string value attributes, such as brand name.

  • Date – The data attributes, such as start date and end date.

  • JSON: Represents attributes for selecting JSON object data.

  • List: Represents attributes for selecting data as lists or arrays.

Note: You cannot leave the global attribute value field blank. You must always provide a value for every global attribute.

The following figure shows the Global Variable page of the Nected platform:

Creating Global Attributes

To create a global attribute, follow the below steps:

  1. Click Global Variable in the left navigation to open the Global Variable page.

  2. Click + Add Value and select an attribute type from the dropdown, such as Numeric.

  3. After selecting the attribute type, you'll see two fields, one for the Key and one for the Value. You must provide the attribute name in the Key field and enter the attribute value in the corresponding field.

    For adding JSON and LIST attributes, you need to add the information inside the JSON and LIST editor, which we've discussed in the below section.

  4. Click Save to save the attribute.

After you save the attribute, you can use it in any of the rules.

Adding JSON & LIST attributes:

To add JSON or LIST attributes, simply click on the "+Add Value" and from the dropdown list select JSON/LIST as per your requirement. Then,

  1. For the JSON attribute, you'll get a JSON editor. Just click on the JSON Editor, and the editor will be open like this:

  2. Then you can add custom data inside the JSON editor via Raw mode i.e. using low code or via Pretty mode i.e. via no code mode.

  3. After adding your custom JSON data inside the editor, you need to test it and simply close it.

The same thing goes for the LIST attribute.

  1. After selecting the LIST attributes, you need to open the list editor.

  2. Then open the list editor and add the values according to your need. And then test it and simply close it. The list data will be automatically saved.

Using the Global Attributes:

Now, once you've figured out how to create the global attribute, it's pretty easy to use them inside your rule and workflow. But before understanding how you can use the global attribute, you first need to know where you can use global attributes. So, you can use it in:

  1. Rule Conditions: To add the global attribute in the rule condition, simply add a new condition, and after adding an operator, click on the "Enter Value" field and a dropdown list will appear. Scroll down to the "Global attributes" section and select the matching datatype.

  2. Rule Result: Similarly, click on "+Add Result" and add a new result. And in the input field just select the Global attribute from the dropdown.

  3. In Workflow editor: In the workflow editor, you can use the global attributes as the input values in the rule node, workflow node, Switch Block Node, as well as in the SetVariable Node, like shown below:

Modifying Global Attributes

Update the value of a global attribute to modify the attribute value throughout the rules and workflows that are using this attribute.

The following procedure shows you how to update an existing global attribute on the Nected platform:

  1. Click Global Variables in the left navigation to open the page.

  2. Edit the attribute value and click Update against the attribute name.

Deleting Global Attributes

The following procedure shows you how to delete an existing global attribute from the Nected platform:

  1. Open the Global Variable page by clicking the same button from the left navigation bar.

  2. Click the delete icon against the attribute name. Then a Delete Attribute dialogue box will open.

  3. Click Delete to confirm the delete operation.

After you delete the attribute, you must remove it from any rule or workflow that uses this global attribute, else you'll get error.

Last updated