List Editor
Last updated
Last updated
The List editor in Nected is a versatile tool designed for managing list data within various contexts. It offers two editing modes: a raw code editor for direct list input and a low-code interface with add-item buttons for easier manipulation. This dual functionality allows users to handle list data effectively across rule inputs, rule results, and workflow nodes. Additionally, the editor supports token integration, enabling dynamic and context-aware list data management.
Same as the JSON editor, the List editor is also available inside:
Rule
As Input params
Rule Result
Workflow:
In trigger node
In SetVariable node
Response node
Let’s see how you can access the List Editor and write your custom code there:
You can easily use the List editor within the input attributes as an input parameter in the rule editor. If you want to set exhaustive data inside a single parameter, using a list as input is ideal. Follow these steps to access and utilize the List editor for rule input parameters:
Navigate to the rule editor by selecting the desired rule.
Click on “+Add Input Attribute” to open the “Input Attribute” modal.
In the “Input Attributes” tab of the modal, click on “Add field” and provide a property name.
From the datatype dropdown, select List. This action will open the List Editor.
In the List editor, you can add items for later use. Note that tokens cannot be used within the “Input Attributes” section.
Example Code:
Inside a List, you can add string, numeric, boolean, date, date time, nested list, and even JSON type data as well.
You can not use tokens for this scenario, as here you’re configuring the input attributes for the rule, so no tokens are available at this point.
The List editor allows you to manage the output results of rules effectively. Here’s how to access and use the List editor for rule results:
Open the rule editor by selecting the desired rule.
Navigate to the Result section of the rule editor.
Click on “Add Result” and choose List from the dropdown list.
The List editor will open, allowing you to add items. You can use tokens such as customInput
, globalVar
, outputData
, additionalData
, dataSet
, and NULL
in this section.
Example Code:
In the workflow editor, you can configure input parameters for the workflow trigger node using the List editor. Follow these steps:
Open the workflow editor by selecting the relevant workflow.
Click on the trigger node to open a side modal, which contains three tabs.
In the “Input Params” tab, select List from the dropdown menu to add items. This section functions as input attributes for the workflow editor, and tokens cannot be used here.
Example Code:
Same as in the rule, tokens cannot be used in this section as the function as input attributes for the workflow editor.
The List editor can also be used to manage variables within the workflow set variable nodes. Here’s how:
Open the workflow editor by selecting the relevant workflow.
Click on the “+” icon and choose the SetVariable node from the list.
In the side modal that appears, click on "+ Add Field” and select List from the dropdown list.
The List editor will open, allowing you to add items. Tokens can be used in this section to make the list data dynamic.
Example Code:
The List editor facilitates defining the response data for workflow response nodes. Here’s how to access and use it:
Open the workflow editor and select the relevant workflow.
Click on the “+” icon and select the Response node from the list.
In the side modal that appears, choose List from the dropdown list to add items. You can use any available tokens in this section.
Example Code:
The List editor in Nected provides a flexible interface for managing list data, allowing you to switch between raw code input and a low-code, pretty format interface. This section will guide you through using both formats effectively.
The raw format is ideal for users who are comfortable writing list data directly. This mode allows you to input list data with full control over the syntax and structure.
Access the List Editor: Navigate to the relevant section (e.g., rule input parameters, rule results, workflow nodes) and open the List Editor as described in the respective sections.
Select Raw Code Mode:
In the List editor, choose the option to write raw code.
This will present a text area where you can manually enter your list data.
Enter List Data:
Write your list data directly into the text area. Ensure that the data adheres to standard JSON list syntax, including proper use of square brackets []
, commas, and correct nesting for objects and arrays.
Example of Raw List Input:
The pretty format, also known as the low-code mode, provides an intuitive interface with add-item buttons that simplify the process of structuring and editing list data. This mode is particularly useful for users who prefer a visual approach to list editing.
Access the List Editor: Navigate to the relevant context (e.g., rule input parameters, rule results, workflow nodes) and open the List editor as described in the respective sections.
Select Pretty Format Mode:
In the List editor, choose the option to write in the pretty format (low-code mode).
This will present a form-like interface where you can add items without manually writing list syntax.
Add Items:
Use the add item buttons to create new items in your list structure.
Enter the corresponding values for each item. You can add nested objects and lists by selecting the appropriate options from the interface.
Incorporate Tokens:
If tokens are available in the context you are working in, you can incorporate them into your list data by selecting from the available token options and assigning them to the appropriate items.
Example of Pretty List Input:
Initial Items:
Add an item with the value "ABC"
.
Add an item that is a list containing 2000
, "Nected"
, and "2024-07-02"
.
Add an item with the value "2024-07-02T05:47:10Z"
.
Nested Object:
Add an item that is an object.
Inside the object, add a key named key_name_1
with a value of "Rule Engine"
.
Add a key named key_name_2
with a value of true
.
This will automatically generate the list structure in a pretty format without needing to write the raw code manually.
After writing the List data you can test it using the test button and check if everything is working fine or not.
Syntax Errors: If your list data contains syntax errors, the editor will highlight the issues. Correct the highlighted areas and revalidate your list.
Token Issues: Ensure that tokens are correctly referenced and available in the context you are using them.
The List editor in Nected is a powerful tool that enhances your ability to manage list data seamlessly across different parts of the application. By understanding how to access and utilize the List editor in various contexts, you can streamline your workflow and ensure dynamic, flexible data handling. For further assistance, refer to Nected's support resources or contact the support team.
This detailed documentation provides a comprehensive guide on using the List editor in Nected. Should you have any further questions or need additional examples, feel free to reach out for more information.