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

# SORT_NATURAL

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

Sorts elements in an array by a property of an element in the array (case-insensitive). Pass a dot-separated path to sort by nested keys.

**Categories:** Arrays

## Syntax

```
SORT_NATURAL(array, path, [include_json_paths: FALSE])
```

## Examples

### Example 1

Input:

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

Formula:

```
SORT_NATURAL(my_action.message)
```

Output:

```json
[
  "east",
  "north",
  "South",
  "west"
]
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "SORT NATURAL",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "sort_natural": "=SORT_NATURAL(my_action.arr1)"
        }
      },
      "position": {
        "x": -6585,
        "y": -1395
      },
      "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": {
          "arr1": [
            "dog",
            "cat",
            "Llama",
            "BEAR",
            "4"
          ]
        }
      },
      "position": {
        "x": -6585,
        "y": -1515
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 1,
      "receiverIdentifier": 0
    }
  ],
  "diagramNotes": []
}
```
