Flatten List
Uncontrolled node
Overview
Remove levels of nesting from a list.
Combine nested lists into a flatter list while preserving item order. Only list nesting is removed; objects and their fields are left intact.
This node is evaluated when another node needs its output. It has no run or done event.
Inputs
| Input | Type | Description |
|---|---|---|
| list | List | The nested list to flatten. |
Properties
| Setting | Type | Description |
|---|---|---|
| depth | Number | Number of nesting levels to remove. Defaults to 1. Fractions are rounded down; missing, invalid or below-one values use 1. |
Outputs
| Output | Type | Description |
|---|---|---|
| output | Data | Flattened list. An empty list or non-list input is returned unchanged. |
Examples
| Input list | Depth | Output |
|---|---|---|
[[1, 2], [3, 4]] | 1 | [1, 2, 3, 4] |
[[[1, 2]], [[3, 4]]] | 1 | [[1, 2], [3, 4]] |
[[[1, 2]], [[3, 4]]] | 2 | [1, 2, 3, 4] |
Connect the nested list to list, set depth in the properties panel and use output downstream. This does not extract arrays stored inside an object: first use Get Value or Map List to select those arrays.