Pre-Configured Tokens

In Nected, tokens are pivotal for referencing various inputs, outputs, and data attributes across workflows. Tokens allow you to re-use any previously defined data in subsequent workflow steps, enhancing the flexibility and efficiency of your rule executions. The table below outlines the availability of different tokens in various contexts within custom code and JSON results:

Token NameAvailable in custom code in conditionsAvailable in custom code in result/dataAvailable in JSON in result/dataAvailable in additional dataAvailable in actionsAvailable in WorkflowReferring tokens inside rulesReferring tokens side workflow

customInput

Yes

Yes

Yes

Yes

Yes

Yes

{{.customInput.customer_location}}

{{.Trigger.date}}

globalVar

Yes

Yes

Yes

Yes

Yes

Yes

{{.globalVar.base_price}}

{{.globalVar.base_price}}

outputData

No

Yes

Yes

Yes

Yes

Yes

{{.outputData.Discount}}

{{.New_Rule.output[0]}}

additionalData

No

No

No

No

Yes(in DT)

No

{{.additionalData.total_price}}

{{.additionalData.total_price}}

dataSet

Yes

Yes

Yes

Yes

Yes

Yes

{{.dataSet.price}}

{{.MS-SQL(PROD).output[0].optname}}

NULL

Yes

Yes

Yes

Yes

Yes

Yes

{{.systemVar.NULL}}

{{.systemVar.NULL}}

action

No

No

No

No

No

Yes(only if the Rule action is toggled on)

{{.Rule_name.action.action_name}}

{{.Lead_Allocation.action.action_1}}

Using tokens, you can reference any previous outputs, input attributes, custom input attributes, etc. This allows you to reuse previous outcomes in subsequent steps, ensuring seamless data flow and efficient workflow execution.

Available Pre-Configured tokens:

Below are detailed explanations of the behavior and usage for each token available in Nected, starting with the customInput token and proceeding through other critical tokens such as globalVar, outputData, additionalData, dataSet , and NULL. While using the tokens after writing the tokens, if you hover them you can actually

1. customInput

In Nected, customInput tokens are fundamental for accessing various input attributes across your workflows. They are available in rule conditions, rule results, custom code, JSON results, and several workflow nodes. These tokens help you reference user-defined inputs, enhancing the reusability and flexibility of your workflows. This section outlines how to effectively use customInput tokens in different contexts within Nected.

Steps to use customInput tokens

1. Rule Condition

  1. Open the Rule Editor: Open Nected’s dashboard and navigate to the Rule Editor page.

  2. Select the Rule and Attribute: Choose the rule and locate the condition where you want to use a customInput attribute.

  3. Click the Attribute Dropdown: Open the dropdown menu in the attribute field and chose any between the List or Custom JS Editor or Formula editor. Then the respective editor will be open in front of you.

  4. Select the customInput Option: Choose the appropriate customInput attribute from the list.

  5. Test and Save: Test the rule and save your changes.

2. Rule Result

Same as rule condition, customInput token is available here in List, JS Code, Formula and for JSON. Here is the step to use it:

  1. Navigate to Rule Results: Go to the results configuration within the Rule Editor.

  2. Choose Editor: Click on “Add Result” and select any of these[JSON, JS Code, Formula].

  3. Insert customInput Token: Use {{.customInput.attribute_name}} for JavaScript and "attribute": "{{.customInput.attribute_name}}" for JSON.

  4. Test and Save: Validate and save your custom code

3. Workflow Nodes

a. Custom Code Node

  1. Add Custom Code Node: Insert a custom code node in your workflow.

  2. Configure customInput Token: Use {{.Trigger.attribute_name}} in your code.

  3. Test and Save: Ensure the code works correctly with the Trigger value and save.

b. SetVariable Node

  1. Add SetVariable Node: Insert a SetVariable node in your workflow.

  2. Set customInput Value: Open the dropdown menu in the attribute field and chose any between the List or Custom JS Editor or Formula editor. Then the respective editor will be open in front of you. Choose the attribute and set its value using {{.Trigger.attribute_name}}.

  3. Test and Save: Validate and save the configuration.

c. Inside Rule Node Input Attribute

  1. Add Rule Node: Add a rule node to your workflow.

  2. Set Input Attribute to customInput: Configure the input attribute with customInput.

  3. Test and Save: Test and save your changes.

d. Workflow Node as Input Attribute

  1. Add Workflow Node: Add a workflow node in your workflow.

  2. Configure customInput Attribute: Set an input attribute with customInput.

  3. Test and Save: Validate the setup and save your changes.

Implementations

  1. Data Reuse: customInput tokens allow you to reuse input attributes across multiple rules and workflows, reducing redundancy.

  2. Dynamic Workflows: They enable dynamic workflows where input values can influence the flow and outcome based on user-defined criteria.

  3. Customization: Using customInput, you can tailor rules and workflows to specific scenarios, improving overall efficiency and effectiveness.

By understanding and leveraging customInput tokens, you can design more flexible and robust workflows in Nected.

2. globalVar

In Nected, globalVar tokens provide access to global variables that are consistent across different rules and workflows. These tokens are available in rule conditions, rule results, custom code, JSON results, and several workflow nodes. globalVar tokens are useful for maintaining consistency and reusing common data points throughout your workflows. This section outlines how to use globalVar tokens effectively.

Steps to use globalVar tokens

1. Rule Condition

  1. Open the Rule Editor: Navigate to the Rule Editor.

  2. Select the Rule and Attribute: Choose the rule and condition where you want to use a globalVar attribute.

  3. Click the Attribute Dropdown: Open the dropdown menu in the attribute field.

  4. Select the globalVar Option: Choose the appropriate globalVar attribute.

  5. Test and Save: Test the rule and save your changes.

2. Rule Result

  1. Navigate to Rule Results: Access the results configuration.

  2. Set Attribute to globalVar: Follow the steps to select and use a globalVar attribute.

  3. Test and Save: Test and save the changes.

3. Custom Code (JS+JSON)

  1. Open Custom Code Editor: Access the custom code options.

  2. Insert globalVar Token: Use {{.globalVar.attribute_name}} for JavaScript and "attribute": "{{.globalVar.attribute_name}}" for JSON.

  3. Test and Save: Validate and save your custom code.

4. Workflow Nodes

a. Custom Code Node

  1. Add Custom Code Node: Insert a custom code node in your workflow.

  2. Configure globalVar Token: Use {{.globalVar.attribute_name}} in your code.

  3. Test and Save: Ensure the code works correctly with the globalVar value and save.

b. SetVariable Node

  1. Add SetVariable Node: Insert a SetVariable node in your workflow.

  2. Set globalVar Value: Choose the attribute and set its value using {{.globalVar.attribute_name}}.

  3. Test and Save: Validate and save the configuration.

c. Rule Node as Input Attribute

  1. Add Rule Node: Add a rule node to your workflow.

  2. Set Input Attribute to globalVar: Configure the input attribute with globalVar.

  3. Test and Save: Test and save your changes.

d. Workflow Node as Input Attribute

  1. Add Workflow Node: Add a workflow node in your workflow.

  2. Configure globalVar Attribute: Set an input attribute with globalVar.

  3. Test and Save: Validate the setup and save your changes.

Implementations

  1. Consistency: globalVar tokens ensure consistent use of global variables across different rules and workflows.

  2. Reusability: They allow for the reuse of common data points, reducing redundancy.

  3. Efficiency: Using globalVar tokens can streamline workflows by centralizing variable management.

By leveraging globalVar tokens, you can maintain consistency and improve efficiency in your Nected workflows.

3. outputData

In Nected, outputData tokens are used to reference data generated by previous rules or steps within a workflow. These tokens are available in rule results, custom code, JSON results, and several workflow nodes. outputData tokens are essential for using previous outputs in subsequent steps, ensuring seamless data flow. This section outlines how to use outputData tokens effectively.

Steps to use outputData tokens

1. Rule Result

  1. Navigate to Rule Results: Go to the results configuration within the Rule Editor.

  2. Select JS Code or List or JSON: Select the attribute as JS or List or JSON and use the appropriate outputData token inside the editor.

  3. Test and Save: Test the rule result and save the changes.

2. Rule Action

  1. Click Add Action: Click the “+Add Action” button and select any database you want to call as a rule action. Then choose the database from the given list.

  2. Insert outputData token: Inside the dataset editor, you can add custom SQL code to insert or update the dataset according to your rule condition. Now,

    1. For simple rule: For Simple rule, the outputData token will look like this: {{.outputData.key_name_1}} , basically inside simple rule you can use outputData token to call single attributes and use that inside your dataset code.

    2. For Decision Table: Inside DT, you can actually call the complete list of the output, using outputData token like this: {{.outputData.output[0]}} . So here it return, this token will return the complete list like this:

2. Custom Code (JS+JSON)

  1. Open Custom Code Editor: Access the custom code options.

  2. Insert outputData Token: Use {{.outputData.attribute_name}} for JavaScript and "attribute": "{{.outputData.attribute_name}}" for JSON.

  3. Test and Save: Validate and save your custom code.

3. Workflow Nodes

a. Custom Code Node

  1. Add Custom Code Node: Insert a custom code node in your workflow.

  2. Configure outputData Token: Use {{.outputData.attribute_name}} in your code.

  3. Test and Save: Ensure the code works correctly with the outputData value and save.

b. SetVariable Node

  1. Add SetVariable Node: Insert a SetVariable node in your workflow.

  2. Set outputData Value: Choose the attribute and set its value using {{.outputData.attribute_name}}.

  3. Test and Save: Validate and save the configuration.

d. Workflow Node as Input Attribute

  1. Add Workflow Node: Add a workflow node in your workflow.

  2. Configure outputData Attribute: Set an input attribute with outputData.

  3. Test and Save: Validate the setup and save your changes.

Implementations

  1. Data Flow: outputData tokens ensure seamless data flow by allowing previous outputs to be used in subsequent steps.

  2. Efficiency: They help create efficient workflows by reducing redundancy and reusing data.

  3. Complex Logic: Using outputData tokens enables the implementation of complex logic that relies on previous outputs.

By understanding and utilizing outputData tokens, you can enhance the efficiency and flexibility of your Nected workflows.

4. additionalData

In Nected, additionalData tokens are unique and specifically available within Decision Tables. These tokens allow you to incorporate supplementary data directly into the actions of a Decision Table, enhancing the flexibility and functionality of your rules. The dedicated area for adding additionalData in a Decision Table is shown below.

Steps to use additionalData tokens

1. Adding additionalData in Decision Table

  1. Open the Decision Table Editor: Log in to the Nected platform and navigate to the Decision Table Editor from the main dashboard.

  2. Add additionalData: Within the Decision Table Editor, locate the dedicated section for adding additional data, as shown in the image below.

    • Click on the "+ Add additional data" link.

    • Enter the name of your data attribute (e.g., data1).

    • Select the data type (e.g., JS Code) and configure it as needed.

  3. Set Attribute Values: Define the values for your additional data attributes using the appropriate syntax or JavaScript code.

2. Using additionalData in Actions

  1. Navigate to Actions: Within the Decision Table, move to the actions configuration.

  2. Insert additionalData Token: Use the additionalData attributes defined earlier in your action definitions. The syntax for referencing additionalData in actions is {{.additionalData.attribute_name}}.

    Example:

    {
      "action": "setAttribute",
      "attribute": "total_price",
      "value": "{{.additionalData.data1}}"
    }
    
  3. Test and Save: Validate the configuration by testing the Decision Table. Once confirmed, save your changes.

Implementations

  1. Supplementary Data Handling: additionalData tokens enable the inclusion of extra data points that may not be part of the primary inputs or outputs but are essential for specific rule actions.

  2. Enhanced Decision Making: By incorporating additionalData, you can create more nuanced and flexible decision-making processes within your Decision Tables.

  3. Custom Logic Implementation: Using additionalData allows you to implement custom logic that can reference additional information dynamically.

By leveraging additionalData tokens in Decision Tables, you can enhance the capabilities of your rule actions and ensure more comprehensive and flexible data handling within Nected.

This revised section should clearly explain how to use the unique additionalData tokens within the Decision Table context.

5. dataSet

In Nected, dataSet tokens are used to reference data from predefined datasets. These tokens are available across rule conditions, rule results, custom code, JSON results, and multiple workflow nodes. dataSet tokens enable you to incorporate external datasets into your workflows, enhancing data-driven decision-making. This section outlines how to use dataSet tokens effectively.

Steps to use dataSet tokens

1. Rule Condition

  1. Open the Rule Editor: Navigate to the Rule Editor.

  2. Select the Rule and Attribute: Choose the rule and condition where you want to use a dataSet attribute.

  3. Click the Attribute Dropdown: Open the dropdown menu in the attribute field.

  4. Select the dataSet Option: Choose the appropriate dataSet attribute.

  5. Test and Save: Test the rule and save your changes.

2. Rule Result

  1. Navigate to Rule Results: Go to the results configuration within the Rule Editor.

  2. Set Attribute to dataSet: Select the attribute and use the appropriate dataSet token.

  3. Test and Save: Test the rule result and save the changes.

Now, inside the rule result, you can actually see the matching and non matching data for the true and false result. Means you’ll get the list of the JSON of the dataset row for which you’re getting the true or false result. To do this,

  1. You need to just go to the rule result section. And there you can just click on either LIST editor, JS editor or JSON editor. You can call this inside only these 3 places.

  2. Call the dataset.resultData token there

  3. After writing the tokens, you can test if if it is working or not. Just test the rule and check if the result is actually showing the same row of the dataset for which the rule succeed or failed. The row will be shown as a list of a JSON, like this:

        "key_name_2": [
          {
            "enagagement_metrics": 5,
            "id": 1,
            "page_layout": "Layout B",
            "user_segment": "Low"
          }
        ]

3. Custom Code (JS+Formula+JSON)

  1. Open Custom Code Editor: Access the custom code options.

  2. Insert dataSet Token: Use {{.dataSet.attribute_name}} for JavaScript and "attribute": "{{.dataSet.attribute_name}}" for JSON.

  3. Test and Save: Validate and save your custom code.

4. Workflow Nodes

a. Custom Code Node

  1. Add Custom Code Node: Insert a custom code node in your workflow.

  2. Configure dataSet Token: Use {{.dataSet.attribute_name}} in your code.

  3. Test and Save: Ensure the code works correctly with the dataSet value and save.

b. SetVariable Node

  1. Add SetVariable Node: Insert a SetVariable node in your workflow.

  2. Set dataSet Value: Choose the attribute and set its value using {{.dataSet.attribute_name}}.

  3. Test and Save: Validate and save the configuration.

c. Rule Node as Input Attribute

  1. Add Rule Node: Add a rule node to your workflow.

  2. Set Input Attribute to dataSet: Configure the input attribute with dataSet.

  3. Test and Save: Test and save your changes.

d. Workflow Node as Input Attribute

  1. Add Workflow Node: Add a workflow node in your workflow.

  2. Configure dataSet Attribute: Set an input attribute with dataSet.

  3. Test and Save: Validate the setup and save your changes.

Implementations

  1. External Data: dataSet tokens enable the incorporation of external datasets into your workflows.

  2. Data-Driven Decisions: They facilitate data-driven decision-making by leveraging predefined datasets.

  3. Complex Logic: Using dataSet tokens allows for the implementation of complex logic based on external data sources.

By utilizing dataSet tokens, you can enhance the data-driven capabilities of your Nected workflows.

These detailed explanations should help in understanding the behavior and usage of each token in Nected, ensuring efficient and flexible workflow execution.

6. NULL

In Nected, NULL tokens are versatile and can be used across various elements within the platform. They are available in rule conditions, rule results, rule actions, custom code (both JS and JSON), and multiple workflow nodes. NULL tokens serve the purpose of representing an empty or undefined value within a field, which is crucial for data integrity, error handling, and conditional logic. This section outlines the steps to effectively set attributes to NULL in different contexts within Nected.

Steps to use NULL tokens

1. Rule Condition

  1. Open the Rule Editor: Log in to the Nected platform and navigate to the Rule Editor section from the main dashboard.

  2. Select the Rule and Attribute:

    1. Choose the rule you want to modify.

    2. Locate the condition where you want to set the attribute value to NULL.

  3. Click the Attribute Dropdown:

    1. Click on the attribute field to open the dropdown menu.

    2. Scroll through the list of available attributes.

  4. Select the NULL Option: Find and select the 'NULL' option from the dropdown menu.

  5. Test the Rule: After setting the attribute to NULL, test the rule to ensure proper functionality.

  6. Save the Rule: Save your changes by clicking the 'Save' button.

2. Rule Result

  1. Navigate to Rule Results: Within the Rule Editor, move to the results configuration.

  2. Set Attribute to NULL: Follow similar steps to select the attribute and set its value to NULL.

  3. Test and Save: Test the rule result and save the changes.

3. Custom Code (JS+JSON)

  1. Open Custom Code Editor: In the Rule Editor, go for the custom code options like:

    1. Custom Functions: While creating the rule condition, you can find an option for Custom Functions, inside which you’ll find two options: JS Code and Formula. You can use the {{systemVar.NULL}} for both of them.

    2. Inside the Rule result, you can select JS Code or JSON Editor where you can also use the NULL token according to your usage.

  2. Insert NULL Token:

    • For JavaScript: Insert {{.systemVar.NULL}} where necessary.

    • For JSON: Add "attribute": "{{.systemVar.NULL}}".

  3. Test Custom Code: Validate the custom code by running tests.

  4. Save Changes: Save your custom code settings.

4. Workflow Nodes

a. Custom Code Node (Same as rule)

  1. Add Custom Code Node: Navigate to the workflow and add a custom code node.

  2. Configure NULL Token: Insert the NULL token in your code similarly to the steps above.

  3. Test the Code: Ensure the code operates correctly with the NULL value.

  4. Save: Save the changes.

b. SetVariable Node

Inside SetVariable Node, you can use {{.systemVar.NULL}} by selecting any of the datatypes given below, along with custom JS or JSON or Formula editor.

  1. Add SetVariable Node: Insert a SetVariable node into your workflow.

  2. Set NULL Value: Choose the attribute and set its value to NULL.

  3. Validate and Save: Test and save your configuration.

c. Rule Node as Input Attribute

  1. Add Rule Node: Add a rule node in your workflow.

  2. Set Input Attribute to NULL: Configure the input attribute to be NULL.

  3. Test and Save: Validate the setup and save your changes.

d. Workflow Node as Input Attribute

Same as the rule node, follow these:

  1. Add Workflow Node: Integrate a workflow node in your current workflow.

  2. Configure NULL Attribute: Set an input attribute within this node to NULL.

  3. Test and Save: Test the workflow to ensure everything functions correctly, then save.

Implementations

  1. Data Cleansing: Setting attributes to NULL can be particularly useful for data cleansing processes. When certain data points are no longer relevant or need reset, assigning them a NULL value ensures that they do not interfere with other rule conditions or results.

  2. Conditional Logic: In complex conditional logic, there might be scenarios where the absence of a value (NULL) needs to be explicitly checked. By setting attributes to NULL, you can create rules that handle these cases more effectively.

  3. Error Handling: Using NULL values can also aid in error handling. For instance, if an attribute should be ignored due to invalid or missing data, setting it to NULL can help bypass or flag those records appropriately.

Users can design more efficient and robust workflows by understanding and leveraging NULL tokens across various contexts in Nected contexts.

7. action

The action tokens are unique and specifically available in workflow if and only if you’re using a rule node and the rule action is toggled on. These tokens allow you to incorporate the rule action data directly into any other node in the workflow, enhancing the functionality of your workflow. Here are all available action tokens:

{{.Rule_name.action}}, //all available Actions
{{.Rule_name.action.action_name}}, //single action
"{{.Rule_name.action.action_name.error}}", //error of a particular action
"{{.Rule_name.action.action_name.executionId}}", //executionID of an action
"{{.Rule_name.action.action_name.name}}" //name of an action

To use the action node, you need to follow these steps:

  1. Open the rule node(if you’ve not created a rule node, read how to create a rule node).

  2. Go to the settings tab, and toggle the “Rule Action” button on.

Now come back to the workflow editor, and go to any node where you want to use the action token. Here is how you can use it:

Conclusion:

Using tokens makes it easier to create rules and workflows based on dynamic components from your database and other integrations. By following this guide, you can effectively implement and utilize the tokens to enhance your rules and workflow management processes, ensuring flexibility and modularity.

Last updated