I don’t want Action2 to apply as soon as I assigned the Protype. I want to run may after 20 minutes so that it gives me to fix the value of $StartDate. Once I fixed the $StartDate, the $EndDate calculates the values from the value I manually fixed for the $StartDate.
first, a quick syntax note. As written, your ‘action’ won’t work as expected. ‘==’ is an ‘is equal to’ test giving a true/false answer and intended for use in queries, i.e. the if(query){} part of your conditional statement. A single ‘=’ means apply this value (right side to left side) and should not be used for queries.
Here is a solution to the original question above, though I commend the comments in the answer above:
Basically, apart from a syntax fix to action #2, I have added a further enclosing condition with a 3-part query. First we check notes have a $StartDate (we only act on those) and then also check that the $EndDate is not set as we don’t want to re-set existing end-dates (if you do want the latter omit this clause). Lastly, having matched the notes we think need action, we check the $StartDate is at least 20 minutes ago.
The core of the extra query is a simple minutes() calculation. The other terms are there to filter out effects you don’t want. As a general design point it’s best to run actions on as few notes as possible. this is (a) good for overall efficiency performance—at lest in bigger TBXs—and (b) so you don’t mistakenly re-alter notes you didn’t mean to.