Trying to filter interactions older than 3 days in an Architect condition. Using DateTimeDiff(GetNow(), GetInteractionStartTime(), 'd') but the result is always NaN. Tried switching to ‘h’ and dividing by 24, same issue. Is the format of the timestamp string wrong or is there a specific syntax I’m missing for date comparisons?
The issue is almost certainly the timezone mismatch. GetNow() returns the current time in the user’s local context or UTC depending on the flow, but GetInteractionStartTime() is often stored in UTC. If you don’t explicitly align the timezones, the diff calculation can fail or return unexpected results, sometimes manifesting as NaN if the parser gets confused by the string format.
Try forcing both timestamps into the same timezone before running the diff. Here is the working pattern I use for my adherence reports:
DateTimeDiff(
DateTimeFormat(GetNow(), "yyyy-MM-dd HH:mm:ss", "UTC"),
DateTimeFormat(GetInteractionStartTime(), "yyyy-MM-dd HH:mm:ss", "UTC"),
'd'
)
You might also want to check if the interaction start time is actually populated. If a flow runs before the interaction is fully established, that field can be null. Adding a null check helps:
IfNull(GetInteractionStartTime(), GetNow())
Make sure your Architect flow is set to the correct timezone under Flow Settings > Timezone. If it’s set to “User’s Local Time” and the agents are spread across US/Pacific and US/East, you’ll get skewed data. Hardcode it to UTC or a specific region for consistent metric tracking.