Stuck on a seemingly simple date check in an Architect Data Action. Need to filter records where last_updated is older than 7 days.
Using this expression:
DateTimeDiff(now(), entity.last_updated, "d") > 7
It fails validation. The error log shows:
Expression evaluation failed: NaN is not a valid number for comparison. Field: entity.last_updated, Value: 2023-10-27T10:00:00Z
The date format looks standard ISO 8601. Tried casting to string first, but DateTimeDiff expects datetime objects.
Also tested GetDayOfWeek(entity.last_updated) just to see if the parser recognizes the field at all. That returns 1 (Monday), so the field is readable.
Is DateTimeDiff broken for ISO strings? Or do I need a specific format like YYYY-MM-DD without the time component?
My OTel spans show the Data Action starts, hits this expression, and throws the error immediately. No network call happens.
Any workaround that doesn’t involve writing a custom script node? Want to keep this in pure Architect logic for now.