Get 40%-off on all premium templates.
Discount code auto-applied at checkout.
If you're using Notion's sub-items feature, you might find the lack of cohesion between parent-items and sub-items somewhat frustrating. For instance, wouldn't it be convenient if the parent task's "date" property could automatically update based on the dates of its sub-tasks?
I attempted to solve this problem using formulas. Here's what I devised for the date example:
/* Differenciate parent-tasks from sub-tasks (+sub-tasks with empty due dates) */
if(or(empty(prop("Parent-task"))==false,empty((map(prop("Sub-tasks"),current.prop("Due"))).format().replaceAll(",",""))==true),prop("Due"),
/* Create the parent task range */
dateRange(map(
/* Get sub-tasks */
prop("Sub-tasks"),
/* Get sub-tasks due dates */
current.prop("Due").dateStart())
/* Sort dates in ascending order */
.sort()
/* Get the most recent date */
.first()
/* Get its start date */
.dateStart(),
/* Repeat for end date */
map(prop("Sub-tasks"), current.prop("Due").dateEnd()).sort().last().dateEnd())
)
This formula essentially generates a new date range for the parent tasks, using the earliest start date and the latest end date from all of its sub-tasks.
If you want to apply this formula to your own task manager, remember to name your properties as follows: