Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
SOLVED

How to set up a custom Wait time in AJO. (2 days after purchase date)

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@AvinashNa1 

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

 

 



David Kangni

View solution in original post

12 Replies

Avatar

Community Advisor

Avatar

Level 2

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."

Avatar

Community Advisor

Avatar

Level 2

Thanks @Anuhya-Y . 

I tried this. Looks like its accepting for a range of (0-23) for hours. I tried 48, its pushing profile to Error.

 

Thanks

Avatar

Community Advisor

@Anuhya-Y 

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



David Kangni

Avatar

Correct answer by
Community Advisor

@AvinashNa1 

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

 

 



David Kangni

Avatar

Level 2

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

Avatar

Community Advisor

@AvinashNa1 
probably an issue with the copy and paste on your end. It's working without any errors on my side

DavidKangni_0-1752684913624.pngDavidKangni_1-1752684973256.png

Thanks,

David



David Kangni

Avatar

Level 2

Yes @DavidKangni , It works. Thanks a lot for sharing. lot credit to you.

Avatar

Employee Advisor

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/... 

Avatar

Level 2

Thanks @Mohan_Dugganab . This Helps

Avatar

Employee Advisor

@AvinashNa1  try 

 toDateTimeOnly(@event{purchaseDate} + toDuration("P2D"))

refer : https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv...