Expand my Community achievements bar.

SOLVED

Set a custome wait time - wait till next morning 09am - with advanced expression

Avatar

Level 3

Hi,

 

We get some events triggered at 4 am at night and we want to wait until the next day at 9 am until we send the e-mails. 

I saw that I could use the expression field for that, but I have no idea how to code it. I also couldn't really find it in the documentation. 

icostan2_0-1669968704715.png

So I basically want what is already an example in the picture,  but instead of wait till the end of the day, I want to wait till the next morning. How can I do that? 

 

Thank you! 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
8 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Level 2

does the 9 stand for 9am? If I wanted to do 7.30pm would it be 19:30??

Avatar

Level 3

Thank you again for your help! 

I have one additional question. I have a custom wait in the journey to wait till the chosen delivery date is there. That works, but sometimes customers go through the wait at midnight. So then the e-mail is sent at midnight.

 

Is there a way to check the time once a customer is through the wait and then wait till the next morning IF is it midnight? 

 

Avatar

Level 2

You Can set it like this in the custom Type of wait expression

 

toDateTimeOnly(setHours(nowWithDelta(1,"days"),9))

 

Avatar

Administrator

Hi @Taal,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!



Sukrity Wadhwa

Avatar

Level 3

Hi! Thanks for your help so far. I do have one additional question. 

 

If the event is triggered at night, I want to wait till 9 am until the e-mail is sent. But if the event is triggered at 1 pm at day, the e-mail may be sent right away. I only want to prevent sending e-mails at midnight.