How to create birthday=today condition in Journey? | Community
Skip to main content
Level 2
April 3, 2023
Solved

How to create birthday=today condition in Journey?

  • April 3, 2023
  • 1 reply
  • 1377 views

We created the segment with birthday attribute = today where we found the sample profiles shows only shows previous day instead of today. So we want to put the below statement inside the condition node. 

#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate} == toDateOnly(now())
 
But, it is not giving us the right result. do we able to do ignore year in the condition level advanced editor?
In Json, we can use the below code to find the birthday accurately. Because, we dont have any function for getMonth and currentMonth kind of functions in Condition node in Journey.
 
{%#if profile.person.birthDate.getMonth() = currentMonth() and profile.person.birthDate.getDayOfMonth() = currentDayOfMonth() %}Happy Birthdate{%else%}No birthdate today{%/if%}
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by PandiyarajanRa1

Thanks Manoj, we got the correct code to check the comparison of birthdate with today's date. please find the below code for other's reference too. 

 

concat(substr(toString(now()),8,10),substr(toString(now()),5,7))==concat(substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),8,10),substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),5,7))

1 reply

Manoj_Kumar
Community Advisor
Community Advisor
April 4, 2023

Hello @pandiyarajanra1 

 

Try using this to get the day and month from the current date.

concat(substr(toString(now()),8,9),substr(toString(now()),5,6))

 

Manoj     Find me on LinkedIn
PandiyarajanRa1AuthorAccepted solution
Level 2
April 4, 2023

Thanks Manoj, we got the correct code to check the comparison of birthdate with today's date. please find the below code for other's reference too. 

 

concat(substr(toString(now()),8,10),substr(toString(now()),5,7))==concat(substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),8,10),substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.birthDate}),5,7))