Flatten Component
Unnest nested arrays and normalize complex JSON structures.
Last updated:
The Flatten Component is used to "explode" nested arrays into individual records, making it easier to process data in a relational or table-like format.
⚙️ Configuration
| Property | Type | Description |
|---|---|---|
Path to Array | string | The dot-notation path to the nested array you want to flatten (e.g., orders). |
🛠️ Transformation Logic
When you flatten an array:
- Every item in the nested array becomes its own top-level record.
- Properties from the parent record are copied into each new record.
- If the nested array contains primitives (strings, numbers), they are placed under a new key named
{key}_item.
Example:
Input: {"id": 1, "tags": ["red", "blue"]}
Flattening tags results in:
{"id": 1, "tags_item": "red"}{"id": 1, "tags_item": "blue"}