# FLATTEN function

## `FLATTEN` function

| Function Name | Description | Usage | Input parameter | Return value |
|---|---|---|---|---|
| `FLATTEN` | Flattens a JSON array recursively to create a new one-dimensional array. | `FLATTEN()` | N/A | A flattened JSON array. |

## Supported data type


The `FLATTEN` function supports the following data type:

- JSON

## Example: Flatten a nested JSON array


**Sample data** : `$var1$ = [[1, 2], [3, 4]]`


**Usage** : `$var1$.FLATTEN()`
Flatten var1.


**Output** : `[1, 2, 3 ,4]`

## Recommendation

- Learn how to add and configure a [Data Mapping task](https://docs.cloud.google.com/application-integration/docs/configure-data-mapping-task.md.txt)