Flatten
Flatten (flatten)
Flatten nested JSON Objects and Arrays into a single JSON Object containing only top-level fields.
Transform json
Minimal example
actions: - flatten: fields: all-fields: falseJSON
{ "actions": [ { "flatten": { "fields": { "all-fields": false } } } ]}Contents
Fields
| Field | Type | Required | Description |
|---|---|---|---|
fields | Fields | ✅ | The fields that should be flattened (all or a subset). |
description | string | describe this step. | |
condition | lua-expression (string) | Only run this action if the specified condition is met. Examples: 2 * count() | |
preserve-empty-arrays | boolean (bool) | Preserve empty arrays. | |
preserve-empty-objects | boolean (bool) | Preserve empty objects. | |
separator | string | Set the string to separate keys in the flattened object. |
Schema
Fields Options
| Option | Name | Type | Description |
|---|---|---|---|
all-fields | All Fields | bool | Flatten all fields. |
subset | Subset | string[] | Flatten just these fields. |