reverse

Learn how to use the reverse function in Notion formulas.

The reverse() function will reverse the items in a list.

reverse(list)

list.reverse()
Code language: JavaScript (javascript)

If you require reverse sorting, simply sort the list first before reversing.

[1, 5, 4, 3, 2].reverse() /* Output: [2, 3, 4, 5, 1] */

[1, 5, 4, 3, 2].sort().reverse() /* Output: [5, 4, 3, 2, 1] */
Code language: JavaScript (javascript)
reverse(["Luffy", "Zoro", "Nami", "Chopper"])
/* Output: ["Chopper", "Nami", "Zoro", "Luffy"] */Code language: JavaScript (javascript)

reverse() can be useful for sorting a list of dates in reverse chronological order. Consider a Tasks relation in a Projects database. To get a list of the Last-Edited dates with the most recent first, you could write:

prop("Tasks").map(current.prop("Edited")).sort().reverse()Code language: JavaScript (javascript)

The snippet above can be found in the Latest Activity formula within Ultimate Brain, which allows for sorting views of the Projects database by the latest activity in tasks and notes connected to each project.

About the Author

My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

🤔 Have an UB Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas

🤔 Have a Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas