Skip to main content
Level 2
Oct 2, 2023 8:25 PM UTC
Solved

Dynamic date condition in AJO

I have a requirement in the journey that I creating. The requirement is to check on a date attribute to see if it is "y" days from current date i.e., let's say that "end_date" is 'xx-xx-xxxx xx:xx:xx' and it is equal to y days from today's date, then continue with the journey, otherwise end right there. When I pick the date field attribute and try to check if it is current_date + y days, I don't get the current_date option. It looks like the check will happen "y" days after when I create the journey. How do I implement the same in AJO?

sirisha_gantiAccepted solution
Level 2
Oct 11, 2023 6:47 PM UTC

Hi Sathees,

 

I could not respond immediately. The above solution is partially correct. The right function for my use case is nowWithDelta.

 

toDateOnly(toString(nowWithDelta(90,'days')))=toDateOnly("2023-10-06T00:00:00")

 

Your note helped me find the working solution quicker.

 

Thank you,

Sirisha

11 replies

Sukrity_Wadhwa
Employee
Oct 10, 2023 10:51 AM UTC

Hi @sirisha_ganti,

Was the given solution by @satheeskannak helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!

Translate
Sukrity Wadhwa
Level 2
Oct 11, 2023 6:47 PM UTC

Hi Sukrity,

 

Thank you for the follow up. That was helpful.

 

regards,

Sirisha

Translate
Sukrity_Wadhwa
Employee
Oct 12, 2023 5:17 AM UTC

Thanks for the update @sirisha_ganti!

Translate
Sukrity Wadhwa
SatheeskannaK
Level 1
Oct 2, 2023 10:09 PM UTC

@sirisha_ganti, Try this expression in the journey condition considering the end date is 4 days from today.

toDateOnly(toString(inNextDays(now(),4)))==toDateOnly("2023-10-06T00:00:00")

Translate
Thanks, Sathees
sirisha_gantiAuthorAccepted solution
Level 2
Oct 11, 2023 6:47 PM UTC

Hi Sathees,

 

I could not respond immediately. The above solution is partially correct. The right function for my use case is nowWithDelta.

 

toDateOnly(toString(nowWithDelta(90,'days')))=toDateOnly("2023-10-06T00:00:00")

 

Your note helped me find the working solution quicker.

 

Thank you,

Sirisha

Translate
SatheeskannaK
Level 1
Oct 11, 2023 7:39 PM UTC

I'm glad that it was helpful for you. Thanks for posting the solution that worked for your use case.

Translate
Thanks, Sathees