JSON To Items
Configuration reference for creating items from JSON objects and arrays in Pipes
Use this valve to create new items from JSON structures.
Configuration
Section titled “Configuration”| Name | Description | Default | Mandatory | Expanded |
|---|---|---|---|---|
src | Name of the property. | N/A | ||
id_parameter | Parameter containing the id for the created item(s). Defaults to "tmp_x" where x is the index of the array of json objects. | "tmp_" | ||
merge_with_current_item | If operating on a single JSON object (not array) it is convenient to merge values into the current item. | false | ||
unescape | Turns on unescape of src. Use when the source is escaped JSON. | false | ||
array_to_mv | When true, arrays containing scalar values are stored as multi-value item properties instead of JSON strings. Arrays containing objects, nested arrays, or null values keep the legacy string behavior. | false |
{ "name": "JsonToItems", "enabled": true, "config": { "src": "${state.body.items}", "id_parameter": "id", "array_to_mv": true }}Array handling
Section titled “Array handling”By default, array values are stored using the legacy behavior:
- the main property is stored as a JSON string
- indexed properties such as
field[0]andfield[1]are still created
When array_to_mv is set to true, arrays of scalar values such as strings, numbers, and booleans are stored as multi-value properties instead. The indexed properties are still created.
This is useful when a source system returns JSON arrays that should be consumed directly as Pipes multi-value item properties.