Flatten

Take a list that contains multiple lists and convert it into a single list.

Input

Field Definition Type Required
lists

List of lists to be flattened.

Object TRUE

Output

Field Definition Type
list

Flattened list.

Be sure to properly set the type of list.

In the examples below, the type for the first list is Number, but the type for the second list is Text.

Object

Example

Input lists

Output lists

[[1,2,3],[4,5,6],[7,8,9]] [1,2,3,4,5,6,7,8,9]
["one", ["two", ["three", "four"], "five"], "six"] ["one","two","three","four","five","six"]

A list of lists is not a type of list that is common, but you may encounter it from a call to another application or API.

Related topics

About lists

Functions in Workflows

About the elements of Okta Workflows