Question
Dynamic date with dynamic number of days
Hi,
I have a requirement where I want to pass dynamic number in place of <dynamic number> in below expression.
toDateTimeOnly(concat(toString(toDateOnly(nowWithDelta(<dynamic number>, "days"))),"T10:00:00"))
This dynamic number is being calculated in below manner -
toInteger(
(
(toInteger(
toDateTime(
concat(
toString(
#{
ExperiencePlatform.ProfileFieldGroup.profile._acssandboxgdcthree.EventReminders.all(
currentDataPackField.id == ${supplementalId}
).at(0).reminderDate
}
),
"T00:00:00.000Z"
)
)
))
-
(toInteger(
toDateTime(
concat(
toString(
toDateTimeOnly(
toDateOnly(now())
)
),
".000Z"
)
)
))
) / 86400000
) - 14
I tried merging these two like this -
toDateTimeOnly(concat(toString(toDateOnly(nowWithDelta(
toInteger(
(
(toInteger(
toDateTime(
concat(
toString(
#{
ExperiencePlatform.ProfileFieldGroup.profile._acssandboxgdcthree.EventReminders.all(
currentDataPackField.id == ${supplementalId}
).at(0).reminderDate
}
),
"T00:00:00.000Z"
)
)
))
-
(toInteger(
toDateTime(
concat(
toString(
toDateTimeOnly(
toDateOnly(now())
)
),
".000Z"
)
)
))
) / 86400000
) - 14
, "days"))),"T10:00:00"))
However, it gives error -
The expression is invalid : You cannot use the word 'toInteger' like this because it is a keyword of the language. Please, add quotes to fix your expression.
Can somebody help me understand if there’s any workaround to get my code working?
