Dictionary Node
The Dictionary Node allows you to create and manage a collection of key-value pairs dynamically. It provides flexibility in outputting the data either as a JavaScript object or a URL-encoded query string.
Features
- Dynamic addition and removal of key-value pairs
- Configurable output mode (Object or Query String)
- User-friendly modal interface for editing key-value pairs
Inputs
This node does not have any inputs. All data is managed through the node’s interface.
Outputs
- out (string | object): The output can be either a JavaScript object or a URL-encoded query string, depending on the selected output mode.
Properties
- items (array): An array of objects representing the key-value pairs.
- outputMode (string): Determines the format of the output. Can be either “object” or “querystring”.
Usage
-
Adding Key-Value Pairs:
- Click the “Edit Key-Values” button to open the modal interface.
- Use the ”+ Add Key-Value” button to create new pairs.
- Enter the key and value in the respective input fields.
-
Removing Key-Value Pairs:
- In the modal interface, click the “Remove” button next to the pair you wish to delete.
-
Setting Output Mode:
- Use the “Output Mode” dropdown to select between “object” and “querystring”.
-
Connecting to Other Nodes:
- Connect the output to subsequent nodes for further processing.
Output Modes
Object Mode
When set to “object”, the node outputs a JavaScript object containing all key-value pairs.
Example output:
{ "key1": "value1", "key2": "value2"}