Update record based on values for predecessor

Hi there,

I’m trying to solve the following:
In notion I have a “task templates” database that holds the tasks in a sequenced way for repetitive processes. These templates have a “startdate” property and “sequence#” that resembles the timeline of the task sequence.
When duplicating these to my actual task database, I want to set the “actiondate” for task starting with today for the first task in row and for later tasks resembling the offset between the templatetasks.

E.g.
Template T1 - startdate 2025-01-01
Template T2 - startdate 2025-01-02
Template T3 - startdate - 2025-01-15

should lead to
Task T1 - actiondate 2025-01-17 (easy - got that)
Task T2 - actiondate 2025-01-18
Task T3 - actiondate 2025-01-31

My idea was to determine the difference of days between startdate Template T1 and today (got that), save it to a variable and add it to the startdates of Task T2, Task T3.
But I have no idea how to set up this flow so that the variable is set only once and not for each bundle separately.

In a coding environment I would do something like

For each templatetask in …
if sequence# = 1 then offset = datediff(now - startdate) end if
actiondate = dateadd(startdate + offset)
Next

But how to do this non-coding ???
Any help is highly appreciated!

Solved! Found the solution here: