With a key, by what it gives for each item: sort(Tasks, t => t.Due). With "descending", the other way; equal keys keep their order either way, which reverse would not. Empty values and keys go last either way. Text sorts with its numbers read as numbers (item2 before item10), in the reader's order.

Syntax

sort(list, order?) or sort(list, item => key, order?)

Arguments marked ? are optional. An ellipsis (…) allows more arguments.

Try an example

sort([3, 1, 2])

Returns [1,2,3] (list of number).

Your turnAn example, separate from your shelf
Change the example note’s properties

Run the expression to see its result here.

Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.

Use it in your library

The example names the sample note’s properties. In the app, the formula editor shows the same example with your library’s own properties. Write a property name with spaces as prop("Target words"). The formula language reference explains values, operators, and lists.

Browse all functions