---
title: FORCE_ARRAY
url: https://www.tines.com/docs/formulas/functions/force-array/
kind: formula-function
---

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

# FORCE_ARRAY

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

If the supplied argument is an array it returns it, otherwise wraps it in an array

**Categories:** Text

## Syntax

```
FORCE_ARRAY(anything)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": "a string"
  }
}
```

Formula:

```
FORCE_ARRAY(my_action.message)
```

Output:

```json
[
  "a string"
]
```

### Example 2

Input:

```json
{
  "my_action": {
    "message": "Hello World"
  }
}
```

Formula:

```
FORCE_ARRAY(my_action.missing_key)
```

Output:

```json
[]
```

### Example 3

Input:

```json
{
  "my_action": {
    "message": [
      "1",
      "2",
      "3"
    ]
  }
}
```

Formula:

```
FORCE_ARRAY(my_action.message)
```

Output:

```json
[
  "1",
  "2",
  "3"
]
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "2",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "value1": "a string",
          "value2": "Hello World",
          "value3": [
            "\"1\"",
            "\"2\"",
            "\"3\""
          ]
        }
      },
      "position": {
        "x": 1635,
        "y": 2625
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "FORCE_ARRAY",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "value1": "=FORCE_ARRAY(my_action.value1)",
          "value2": "=FORCE_ARRAY(my_action.value2.missing_key)",
          "value3": "=FORCE_ARRAY(my_action.value3)"
        }
      },
      "position": {
        "x": 1635,
        "y": 2730
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
