Skip to main content

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​

InputTypeDescription
listListThe nested list to flatten.

Properties​

SettingTypeDescription
depthNumberNumber of nesting levels to remove. Defaults to 1. Fractions are rounded down; missing, invalid or below-one values use 1.

Outputs​

OutputTypeDescription
outputDataFlattened list. An empty list or non-list input is returned unchanged.

Examples​

Input listDepthOutput
[[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.