SORT will sort the elements in a list. It works on numbers as well as on text. If a string starts with a number will come before strings starting with letters.

Example: Numbers

SORT([5, 76, 1])

This will return [1, 5, 76].

Example: Text

    SORT(['Benjamin', 'Anna', 'Laura', 'Annabelle'])

The sorting will return ['Anna', 'Annabelle', 'Benjamin', 'Laura'], which is then reversed, so the whole expression returns ['Laura', 'Benjamin', 'Annabelle', 'Anna']

Example: Text with Numbers

SORT(['Snow White', '101 Dalmatians', 'Aladdin'])

In this example, one string starts with a number. It will therefore come before the strings starting with letters, so this expression will return ['101 Dalmatians', 'Aladdin', 'Snow White'].

Last updated