Skip to main content
Version: 3.5.3

Action: flatten

Flatten nested JSON Objects and Arrays into a single JSON Object containing only top-level fields.

Field Summary

Field NameTypeDescriptionDefault
conditionexpressionOnly run this action if the condition the specified condition is met-
fieldsarray of fieldsThe list of fields that should be flattened if present-
all-fieldsboolFlatten all fields in the objectfalse
preserve-empty-arraysboolPreserve empty arraystrue
preserve-empty-objectsboolPreserve empty objectstrue
separatorstringSet the string to separate keys in the flattened object-
warn-on-missingboolEmit a warning if a field is missing but was expected to be removedfalse

Fields

condition

Type: expression

Only run this action if the condition the specified condition is met

fields

Type: array of fields

The list of fields that should be flattened if present

all-fields

Type: bool

Default: false

Flatten all fields in the object

preserve-empty-arrays

Type: bool

Default: true

Preserve empty arrays

preserve-empty-objects

Type: bool

Default: true

Preserve empty objects

separator

Type: string

Set the string to separate keys in the flattened object

warn-on-missing

Type: bool

Default: false

Emit a warning if a field is missing but was expected to be removed