This article explains how to automatically display the due date of a task in the project data — by marking the task with a label. This technique is ideal for milestones like Project Start, GoLive, Project End, or other important dates.
The implementation consists of two separate formula flavors:
-
Flavor 1: Determines the task’s
due dateand stores it as atimestamp. -
Flavor 2: Reads the stored
timestampfrom Flavor 1 and displays either a date or an error message.
Important: Both formulas/flavors are created in the project master data.
The following examples show the functionality in three levels of complexity — from simple to fully automated pro logic.
Part 1 – Determine the date from tasks & store it as a timestamp
Flavor 1 generates a timestamp from a task’s due date. This value is stored and later displayed by Flavor 2.
Level 1 – Simplest version (no label, no validation)
This formula stores the due date of all tasks as a timestamp. Only suitable when there is exactly one relevant task.
persist( sumAll(toTimestamp(duedate)) )
Level 2 – Filter by label
This version only considers tasks that contain a specific label ID.
You can find the label ID in two ways:
- In a task that contains the desired label — click the label and select Copy GUID.
- In the Label Manager — open the label, click Configure, then select Copy GUID.
persist(
sumAll('
if(contains(labelIds, "<LABEL-ID>", 1),
toTimestamp(duedate),
0)
')
)Replace: <LABEL-ID> → technical ID of the desired label.
Level 3 – Pro version (full validation)
This version includes full logic with error detection:
- Multiple tasks have the same label → error code
-1 - Exactly one task has the label → store date as
timestamp
persist(
if(
sumAll('if(contains(labelIds, "<LABEL-ID>", 1), 1, 0)', 0) > 1,
-1,
sumAll('
if(contains(labelIds, "<LABEL-ID>", 1),
toTimestamp(duedate),
0)
', 0)
)
)
Part 2 – Display the stored timestamp as a date
Flavor 2 reads the result from Flavor 1 (e.g. from a field like <TIMESTAMP-FIELD>) and displays it in a readable format.
Level 1 – Simple conversion (no validation)
shortDate(
fromTimestamp(
flavor("<SavedDate>")
)
)Simply displays the stored date.
Level 2 – Warning when no date is set
if(
flavor("<SavedDate>") == 0,
"No date set",
shortDate(fromTimestamp(flavor("<SavedDate>")))
)
Level 3 – Pro version (complete error logic)
This version detects:
-
-1→ Multiple tasks are marked -
0or smaller → No date set - Positive value → valid
timestamp
if(
flavor("<SavedDate>") == -1,
"Date not uniquely defined (multiple tasks marked)",
if(
flavor("<SavedDate>") == 0 || flavor("<SavedDate>") < -1,
"No date defined yet",
shortDate(
fromTimestamp(flavor("<SavedDate>") - 2*60*60*1000)
)
)
)
Notes:
- Each milestone should use its own
label. - Flavor 1 (calculation) and Flavor 2 (display) must be placed in separate
flavorfields. - To test the first formula, place it in a task/milestone. Afterwards, both formulas must be moved to the project master data.
- Both formulas/flavors must exist in the project master data — otherwise this method will not work.
- The timezone correction (–2 hours) is optional and can be adjusted or removed.
- This method is ideal for portfolio views and project overviews.
- Additional information on all mentioned functions can be found in the Formulas section of the Help Center
Comments
0 comments
Please sign in to leave a comment.