---
title: FLATTEN
url: https://www.tines.com/docs/formulas/functions/flatten/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# FLATTEN

*[View on tines.com](https://www.tines.com/docs/formulas/functions/flatten/)*

Turn nested arrays into a single 1 dimensional array

**Categories:** Arrays

## Syntax

```
FLATTEN(array)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": [
    [
      "dog",
      "cat",
      "turtle"
    ],
    [
      "deer",
      "bear",
      "tiger"
    ]
  ]
}
```

Formula:

```
FLATTEN(my_action)
```

Output:

```json
[
  "dog",
  "cat",
  "turtle",
  "deer",
  "bear",
  "tiger"
]
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "FLATTEN",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "flatten": "=FLATTEN(my_action.nested_array)"
        }
      },
      "position": {
        "x": -6540,
        "y": -1275
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "nested_array": [
            [
              "cat",
              "turtle"
            ],
            [
              "dog"
            ]
          ]
        }
      },
      "position": {
        "x": -6540,
        "y": -1380
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 1,
      "receiverIdentifier": 0
    }
  ],
  "diagramNotes": []
}
```
