Problem
The flow builder keeps rejecting a custom expression that calculates duration between a webhook payload timestamp and the current session time. Data Action v3.1 pulls the timestamp from an external CRM, strips the milliseconds, but leaves the +00:00 suffix. The Expression Evaluator in Architect throws a validation error before the flow even hits the runtime engine. Switching to a static string in the evaluator works fine, which points to a type coercion issue with dynamic inputs. The timezone handling isn’t the culprit here since the CRM outputs UTC, but the parser still chokes on the offset character. It’s weird how the compile step validates this so strictly. You can’t find a workaround in the current syntax docs. The runtime engine handles ISO 8601 just fine, but the design-time validator doesn’t. Console logs show the expression evaluator is doing jack all with the offset string, just passing it straight to the underlying parser which obviously fails on the plus sign. Trying to figure out if the design-time validator is just overly strict or if the underlying binding actually rejects dynamic offsets.
Code
Here is the expression setup inside the Set Variable block:
DateTimeDiff(
ToString(DataAction_Output.crm_event_time),
DateTimeFormat("yyyy-MM-dd HH:mm:ss"),
"now",
DateTimeFormat("yyyy-MM-dd HH:mm:ss")
)
Error
The validation panel returns this right after saving the block:
{
"type": "invalid_request",
"message": "Expression evaluation failed: The input string was not in a correct format. Parameter name: s",
"status": 400,
"code": "EXPRESSION_PARSER_MISMATCH"
}
Question
Does the built-in DateTimeDiff function actually support the trailing Z or +HH:MM offset when the source is a dynamic variable? Tried wrapping it in Replace(DataAction_Output.crm_event_time, "+00:00", "") but the parser still flags it as a string type mismatch during the initial compile step. The documentation mentions ISO 8601 compatibility, yet the flow builder validation engine seems to expect a strict layout without any timezone markers. Running CXone platform version 2023.11.1 with the latest Architect UI update.
// Fallback attempt that also fails validation
DateTimeDiff(Replace(DataAction_Output.crm_event_time, "+00:00", ""), DateTimeFormat("yyyy-MM-dd HH:mm:ss"), "now", DateTimeFormat("yyyy-MM-dd HH:mm:ss"))
The compile error still points to line 2, character 14.