All tips

Random database sorting

Why would you want a random database sorting? Well, for example, let's consider The Notion Corner (a Notion templates marketplace that I run). While there are many featured templates, I don’t always want the same ones to appear first. Luckily, the website is built on top of Notion (using Super), so all templates are database items. With a random sorting, I can dynamically make sure that the database items changes every minute.

Setting this up is super easy:

  1. Add a “Created time” property
  2. Add a new formula property, call it “Sort order”& input the following code toNumber(slice(format(toNumber(slice(format(timestamp(now())), 7, 9)) * toNumber(slice(format(timestamp(prop("Created time"))), 7, 9)) * 1000), 2, 5))
  3. Sort your database by “Sort order” ascending or descending (doesn’t matter which one)

That’s it! The formula basically gets a number from the timestamp of the “Created time” property, then multiplies it by a number from “now’s” timestamp, while slicing each process. Your database order will now be updated every minute :)

Master Notion, 5 minutes a week

Want to be in the loop with everything Notion? Join the 15,000+ Notioneers on the #1 Notion-focused newsletter.
Every Tuesday, I’ll hit you up with an email, giving you 3 tips on how to make the most of Notion, 2 (awesome) resources, and 1 Tweet of the Week.

Latest issues