Here are some ways to add orders to database items or show last n items. The main idea is relate all the items to one father page, then get a batch of page ids and their orders. All the methods can rank items by created time initially, and the last method can also work for last edited time.
Initial Setting:
Add a filter for son database. When add items, they will automatically relate to Father page. (If you have created some pages, you can select them all, right click, use edit property
to add relation to Father page in batch.
Add formula property id()
(It is the PageID).
Use the Father page to get the rollup of ids. Then the son pages rollup this value (because we cannot directly rollup a rollup property, we need to create a formula property in father db for son pages to rollup.
Using Regex replace, calculate the rank of son page’s id (which is equals to the number of characters before it / 32 + 1).
Notice:
round()
to order formula because when we add a new item, the update of rollup may delay for a while. But since there are no match of this id, the result will + 0.9.... After round, it will be + 1, which is the correct result.Here I use last 3 items as an example to show two ways.