This node allows you to parse strings (typically delimited lists or compact key-value structures) and extract specific values or labels based on their position (zero-indexed). It’s useful for dealing with CSV fields, or string-based encodings.
The Extract JSON Key and Value from String Node is used to split a string based on a delimiter and extract a specific item by index. This node supports two operations:
-
Extracting a value from a delimited string.
-
Optionally, extracting a corresponding key from another delimited string.
The extracted value (and optional key) are then added to the outgoing JSON payload.
Step-by-Step: How to Configure the Node
-
Add the node
-
Drag the Extract JSON Key and Value from String Node from the Logic panel to your canvas.
-
-
Connect to a node that emits string values
-
This must include at least one JSON key containing a string that you want to split and extract from.
-
-
Open configuration
-
Double-click the node to open its configuration window.
-
⚙️ Configuration Fields
🔹 Value Extraction
Field | Requirement | Description |
---|---|---|
Node Name* | Required | Identifier for the node in your workflow. |
Extract Value from String | Required | Enables value extraction logic. |
JSON Key Containing String of Values | Required | The key whose value is a delimited string (e.g., "A,B,C" ). |
Delimiter* | Required | Character used to split the string (e.g., , , ` |
Index (starts at 0)* | Required | Position of the value to extract from the string. Index is zero-based. |
New Output JSON Key for Extracted Value | Required | Field name to store the extracted value in the output JSON. |
🔹 Key Extraction (Optional)
Field | Requirement | Description |
---|---|---|
Extract JSON Key from String (override) | Optional | If enabled, this allows dynamic determination of the output key name. |
JSON Key Containing String of Keys | Required (if used) | Field name that contains the delimited list of keys (e.g., "X,Y,Z" ). |
Delimiter | Required (if used) | Delimiter used to split the key string. |
Index (starts at 0) | Required (if used) | Index used to select which key to assign to the extracted value. |
If Extract JSON Key from String is enabled, the resulting key in the output JSON will be taken from this second string at the same index instead of using the fixed output key.
🧾 Output Behavior
Example 1: Basic Value Extraction
// Input:
{
"sensor_values": "21.5,18.9,22.1"
}
// Config:
- JSON Key: sensor_values
- Delimiter: ,
- Index: 1
- New Output Key: temp2
// Output:
{
"temp2": "18.9"
}
Example 2: Dynamic Key Assignment
// Input:
{
"keys": "temperature,humidity,pressure",
"values": "21.5,60,1013"
}
// Config:
- Extract value from: values (Index 2)
- Extract key from: keys (Index 2)
// Output:
{
"pressure": "1013"
}
🧠 Best Practices
-
Use zero-based indexing consistently—
0
refers to the first element. -
Always sanitize incoming strings upstream to ensure delimiters and structure are as expected.
-
Avoid using dynamic key extraction when keys are not consistent across payloads.
-
Use fixed output key when integrating with dashboards or downstream systems that expect a known schema.
🎯 Use Cases
-
Parse compact string values sent from low-bandwidth devices
-
Extract named values from CSV-style sensor data
-
Dynamically label values when key names are provided separately
-
Convert legacy field structures into JSON format for internal processing
❓ FAQ
Q: What happens if the index is out of bounds?
A: The node will not extract a value for that position and may emit an error or null field depending on the configuration and downstream node expectations.
Q: Can I extract multiple values at once?
A: No. To extract multiple values, duplicate the node and configure each for a separate index.
Q: Can this node handle whitespace around values?
A: Trimming is not automatic. Consider adding a string cleaning or transformation node upstream if needed.