All tips

Sort list by date property

Another great formula 2.0 use from Kavisha: sorting a list by date property.

She uses her habit tracker as an example, which is linked to a Month database where she aggregates the sorted dates and habit completion.

lets(
 currentMonthYear, formatDate(today(), "MMM YY"),

 /** Get all records of current month */
 currentMonthItems, MyHabits.filter(formatDate(current.Date, "MMM YY") == currentMonthYear),

 /** Sort these records by date in ascending order */
 sortedItems, currentMonthItems.sort(current.Date),

 /** Display information in sorted manner */
 sortedItems.map(
   lets(
     info, if(current.Done? == true, "🟢", "⚪"),
     current.Date.format() + ": " + info
   )
 )
)


  • MyHabits is the relation property to the habits database
  • Date is the date property from the habits database
  • Done? is the checkbox property from the habits database

Master Notion, 5 minutes a week

Want to be in the loop with everything Notion? Join the 10,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