Globiflow - Date Logic for Tasks Not Working
Hello -
I have a flow where if a task is marked as completed, there is specific date logic with what date should be applied.
If a user checks off a task that was due in a previous week, the completed date should populate with the due date. Here is the syntax.
[(Item) Completed Date]=="" && date("W", strtotime([Current Date (Y-m-d)])) >= date("W", strtotime([(Item) Due Date] ))
If a user checks off a task that is due in a future week, the completed date should be the Current Date.
[(Item) Completed Date]=="" && date("W", strtotime([Current Date (Y-m-d)])) < date("W", strtotime([(Item) Due Date] ))
For some reason, a user completed a myriad of tasks on 1/4/2021 that were due on 12/22/2020, and the system populated the Completed Date with 1/4/2021, which skewed the reporting.
Do the formulas above look correct? I'm wondering if the flow isn't taking into account the Year, which is why it isn't working.
-
FWIW:
You don't need the IF (Sanity Check) bricks.
Update item
Completed Date = Calc [(Item) Completed Date] == "" ? ( date("YW", strtotime([Current Date (Y-m-d)])) >= date("YW", strtotime([(Item) Due Date] )) ? (date("Y-m-d", strtotime([(Item) Due Date] )) : [Current Date (Y-m-d)] ) : date("Y-m-d", strtotime([(Item) Completed Date]))
Please sign in to leave a comment.
Comments
3 comments