Stuck on getting the right comparison logic in an Architect expression.
- Here is the current expression string I am testing in the simulator:
IF(DateTimeDiff(GetDayOfWeek(CALL.DATE), 1, "DAY") == 0, "TRUE", "FALSE")
- The goal is to flag calls made on Mondays.
GetDayOfWeekreturns an integer (1 for Sunday, 2 for Monday in my region settings).- I expected
DateTimeDiffto calculate the difference between the current day index and the target day index (1 for Sunday). - The result is always false, even on a Monday.
- I suspect
DateTimeDiffexpects actual timestamp objects, not integers. - Is there a cleaner way to do this without complex nested
IFstatements for each day? - I want to avoid hardcoding day names if possible.
- Also, does
GetDayOfWeekrespect the flow’s timezone setting or the caller’s timezone? - I need this to be consistent across our Amsterdam and US east coast queues.
- Any working expression snippet for this?