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