Trying to filter interactions based on when they started. The goal is to see if the interaction started more than 2 hours ago. I’m using the .NET SDK to push data into an outbound campaign via Architect Data Actions.
Here is the expression I’m using in the filter:
DateTimeDiff(sys.interaction.startTime, now(), "hours") > 2
The docs say DateTimeDiff takes two dates and a unit. sys.interaction.startTime is a datetime object. now() returns a datetime. Seems straightforward.
But the result is always empty. No records match. I tried logging the values in a Studio script before the data action hits and sys.interaction.startTime looks like 2023-10-27T14:30:00Z.
Is now() not compatible with DateTimeDiff? Or is there a timezone issue since my app runs in America/Sao_Paulo but the platform is UTC? I don’t see an error, just no data.
Also, GetDayOfWeek works fine for simple checks. Why does the diff function fail silently?