Encapsulate functions when building expressions using the “+” operator

Any function call must be encapsulated with parentheses when using the “+” operator.

Description description

Environment

Adobe Journey Optimizer version 23.10 (AJO version 23.10)

Issue

Building an expression using the “+” operator can generate an error if functions are not encapsulated.

From the advanced expression editor, if you build an expression like this:

toDateTimeOnly(toDateTime(currentTimeInMillis() + 1))

The following error will be generated:

The expression is invalid: You cannot use the character '+' like this because it is a keyword of the language. Please, add quotes to fix your expression.

Resolution resolution

Any function call must be encapsulated with parentheses when using the “+” operator.

Examples:

toDateTimeOnly(toDateTime((currentTimeInMillis()) + 1))
(now()) + (toDuration("PT1H"))

Journey Optimizer Guide: Operators: Logical

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f