SORT

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

Syntax 

SORT(array, sort_key)

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": [
4
"north",
5
"South",
6
"east",
7
"west"
8
]
9
}
10
}

Formula

SORT(my_action.message)

Output

1
[
2
"South",
3
"east",
4
"north",
5
"west"
6
]

Example 2

Input

1
{
2
"animals": [
3
{
4
"name": "Dog"
5
},
6
{
7
"name": "Cat"
8
},
9
{
10
"name": "Bear"
11
}
12
]
13
}

Formula

SORT(animals, 'name')

Output

1
[
2
{
3
"name": "Bear"
4
},
5
{
6
"name": "Cat"
7
},
8
{
9
"name": "Dog"
10
}
11
]

Sample Actions 

Event Transform
SORT
Event Transform
My Action

Select an Action to inspect.

You can also click "Copy Actions" and paste them in your Tines Story to see how they work.

Was this helpful?