Notion has added a nice convenience method to Formulas 2.0. Where you previously may have counted the number of filtered items in a list with:
prop("Tasks").filter(current.prop("Status") == "Done").length()
We can now change filter
to count
and drop the length
call to achieve the same result:
prop("Tasks").count(current.prop("Status") == "Done")
Here’s a simple example using [1, 2, 3]
as the list. We want to know how many items in the list are > 1
.
Length
❌[1, 2, 3].filter(current > 1).length()
Count
✅[1, 2, 3].count(current > 1)
<aside> <img src="/icons/info-alternate_green.svg" alt="/icons/info-alternate_green.svg" width="40px" /> If you’re already a Notion Mastery student, great news—you’ve already got access!
</aside>
With Notion Mastery’s Formula Fundamentals 2.0 course, you’ll learn the basics of programming with Notion and learn every formula feature you’ll need to craft your own potent formula incantations.
Get it as a standalone training or as part of Notion Mastery. 👇