Hi Team,
We have a requirement to wait for 2 days after a purchase date. I tried using setDays(<eventDate>, 2). But its setting the date to 2nd day of the month, rather than 2 days after customer purchase date.
Is there any function that supports this need?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
use
(toDateTimeOnly(<eventDate>)) + (toDuration("P2D"))
or
(toDateTimeOnly(<eventDate>)) + (toDuration("PT48H"))
Another approach is to use 2 wait activities (in case you have less than 50 activities)
first wait with custom wait toDateTimeOnly(<eventDate>) and second wait with duration as 2 days
Thanks,
David
Views
Replies
Total Likes
@AvinashNa1 try function addDays(date, number)
Views
Replies
Total Likes
Thanks for the response @Anuhya-Y , I checked this but this doesn't work on Advanced expression editor. I am doing this on a journey canvas on a Wait activity (Custom).
Here is the error I am facing
"The expression is invalid : Unexpected word 'addDays' . Please, check that it is a valid token and that you are using it at the right place."
Views
Replies
Total Likes
Try toDateTimeOnly(setHours(toDateTime('2025-07-17T00:00:00.00Z'), 48))
Replace the purchase date accordingly. Check out the supported functions documentation links.
Views
Replies
Total Likes
setHours will not work as the function is expecting a number representing the hour (0-23) and is use to force the hour of your date.
Thanks,
David
use
(toDateTimeOnly(<eventDate>)) + (toDuration("P2D"))
or
(toDateTimeOnly(<eventDate>)) + (toDuration("PT48H"))
Another approach is to use 2 wait activities (in case you have less than 50 activities)
first wait with custom wait toDateTimeOnly(<eventDate>) and second wait with duration as 2 days
Thanks,
David
Views
Replies
Total Likes
Hi @DavidKangni
Thanks for sharing great option. But I am seeing this error
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
Views
Replies
Total Likes
@AvinashNa1
probably an issue with the copy and paste on your end. It's working without any errors on my side
Thanks,
David
Views
Replies
Total Likes
Yes @DavidKangni , It works. Thanks a lot for sharing. lot credit to you.
Views
Replies
Total Likes
You can use the expression example similar to the one posted in this thread https://experienceleaguecommunities.adobe.com/t5/journey-optimizer-questions/5-days-wait-on-journey/...
Views
Replies
Total Likes
Thanks @Mohan_Dugganab . This Helps
Views
Replies
Total Likes
@AvinashNa1 try
toDateTimeOnly(@event{purchaseDate} + toDuration("P2D"))
Views
Likes
Replies