SORT

Sorts elements in an array by a property of an element in the array (case-sensitive).

Syntax 

SORT(array, sort_key)

Examples 

Example 1

Input

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

Formula

SORT(my_action.message)

Output

[
  "South",
  "east",
  "north",
  "west"
]
Example 2

Input

{
  "animals": [
    {
      "name": "Dog"
    },
    {
      "name": "Cat"
    },
    {
      "name": "Bear"
    }
  ]
}

Formula

SORT(animals, 'name')

Output

[
  {
    "name": "Bear"
  },
  {
    "name": "Cat"
  },
  {
    "name": "Dog"
  }
]
Was this helpful?