Dynamic date with dynamic number of days | Community
Skip to main content
Adobe Employee
April 10, 2026
Question

Dynamic date with dynamic number of days

  • April 10, 2026
  • 0 replies
  • 31 views

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?

@Pulkit_Jain_  ​@Jennifer_Dungan ​@AutumnE ​@Nick_Hilton ​@ktronolone ​@ChristianeRo1