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.

Add Orders

Orders - son database

Orders - father database

Initial Setting:

  1. 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.

    Untitled

  2. Add formula property id() (It is the PageID).

  3. 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.

  4. Using Regex replace, calculate the rank of son page’s id (which is equals to the number of characters before it / 32 + 1).

Notice:

Show last n items

Here I use last 3 items as an example to show two ways.

Way 1: Get ids of last 3 items, judge if included

Way 1 of last 3 items - son db