---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: flatten (list)
layout: subsection
---

## <a id="section_m3p_myb_5db"></a>Description

Flattens a list containing sublists, and returns a list with a single level containing all elements in the sublists.

## <a id="section_cyq_j1m_zsb"></a>Return Type

`List`

## <a id="section_dz5_pwg_5db"></a>Namespace Function Syntax

```
list:flatten(list) 
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>list</td><td>An array containing 1 or more sub-arrays.</td></tr></tbody></table><br/>

<b>Example</b>

Assume <i>aList</i> is <i>[ [1, 2], [3, 4, 5] ]</i>.

`list:flatten(aList)`

Returns `[1, 2, 3, 4, 5]`

