---
title: SIZE
url: https://www.tines.com/docs/formulas/functions/size/
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)*

# SIZE

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

Returns the number of characters in text or the number of elements in an array.

**Categories:** Text, Arrays

## Syntax

```
SIZE(text_or_array)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": [
      "north",
      "south",
      "east",
      "west"
    ]
  }
}
```

Formula:

```
SIZE(my_action.message)
```

Output:

```json
"4"
```

### Example 2

Input:

```json
{
  "my_action": {
    "message": "north"
  }
}
```

Formula:

```
SIZE(my_action.message)
```

Output:

```json
"5"
```

## Sample actions

```json
{
  "standardLibVersion": "14",
  "actionRuntimeVersion": "4",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "Notice there is a blank line in the array. If you click \"Plain code\", you'll see it shows \"\" and that is counted when using SIZE.",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "array": [
            "array item 1",
            "array item 2",
            "array item 3",
            ""
          ],
          "string": "hello world!"
        }
      },
      "position": {
        "x": 2130,
        "y": -2955
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "SIZE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "array_size": "=SIZE(my_action.array)",
          "string_size": "=SIZE(my_action.string)"
        }
      },
      "position": {
        "x": 2130,
        "y": -2835
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
