iTranslated by AI
Expanding Notion Sub-items by Default
In Notion, you can represent parent-child relationships between items using the database sub-item feature.
In table and list views, sub-items are nested under the parent item, and you can switch between:
- Expand to show
- Collapse to hide
by clicking the toggle button ▶.

Problems with Collapsed View and Solutions
By default, all toggles are collapsed, and only top-level items are displayed. It is tedious to open each toggle one by one to see a list of sub-items and their descendants.
There is a workaround for this problem.
By setting a filter condition where "Sub-item is empty," you can match only the items at the lowest level. In doing so, all toggles leading up to the matched items are opened, resulting in the desired display.
Adding Filter Conditions
Now, the above workaround may not work well when additional filter conditions are added.
Specifically, consider the following case: Suppose we have a database of travel destination candidates with interest levels assigned to them. We want to filter and display items with an interest level of [High]. Ideally, both "Hachioji City" and "23 Wards" should remain.

However, if we set the filter conditions to satisfy both:
- Sub-item is empty
- Interest level is [High]
in an attempt to expand the sub-item toggles, only "Hachioji City" will be displayed and "23 Wards" will not. This is because "23 Wards" has sub-items like "Chiyoda Ward" and "Shinjuku Ward".
Balancing Additional Conditions with Sub-item Expansion
This dilemma can be resolved by replacing the first condition, "Sub-item is empty," with "None of the descendant items have an interest level of [High]." The final filter condition becomes "the first item found with an interest level of [High] when tracing back to the parent from the bottom-most items," which makes the sub-item expansion work correctly.

The first item found with an interest level of [High] when tracing back to the parent from the bottom-most items
Whether or not any descendant items have an interest level of [High] can be determined using Rollup and Formula properties.
First, since sub-items are a relation-type property, they can be aggregated using Rollups. This allows you to get a list of interest levels for sub-items and use Notion functions like includes or every to determine if [High] is included.
Aggregating not only direct sub-items but also descendants can be achieved by adding one auxiliary formula property. For more details, see the following article.
Demo
I have published a demonstration of the filter in action on Notion Sites: https://capable-scorpio-583.notion.site/3043f1fafed480b4971bedbe251c6409. You can check the details of the rollup settings and formula properties by duplicating the page.

Discussion