This question comes from a reader of the Notion course. It has been organized and shared here. If you encounter similar issues while using Notion, feel free to leave a comment.
Requirements
The goal is to randomly display any quote from a "Quotes Database," showing a different quote each time the page is refreshed, with the selection being truly random.
The solution requires combining two previously solved problems:
- How to implement random sorting in Notion
- How to display only the last updated entry in a Notion database
Create a Quotes Database and Add Random Sorting
First, create a database to store your quotes, add an ID field, then use a Formula to randomly sort the ID field:
mod(mod(Last Edited Time.timestamp()/ID.toNumber() * 1.00011979e+8 + 5.00067713e+8, 9.00066731e+8) * mod(timestamp(now()) * 8.00067089e+8 + 8.00068411e+8, 8.00053967e+8) + 9.00067309e+8, 9.00066571e+8)
Create a Display Database with Relation
Next, create a database for displaying random quotes and set up a Relation to link it with every entry in the "Quotes Database":

Use a Formula to Randomly Pick a Quote
Finally, use a Formula to randomly pick one quote to display:
语录数据库.map(current.随机排序).sort().slice(0,1).map(lets( rank1,current, quote,语录数据库.find(current.随机排序==rank1),quote ))Final Result
Here is the effect of displaying random quotes in a Gallery View:

After refreshing:

Note that due to Notion's database performance limitations, there may be some loading delay when refreshing.
📘 FLO.W — Notion Personal Management System
FLO.W is a Notion-based personal management template that integrates tasks, notes, projects, habits, and more, complete with comprehensive tutorials.


