Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

How to extract year from date in AJO using fx function?

Avatar

Level 2

We want to supply Year in Custom action from the field called registration Date which is in format "YYYY-MM-DD".
Inside AJO which fx function we should use to extract year from the same.

For example, RegistrationDate ="2022-07-08" , we want to use field as StartYear having value "2022".

Please assist.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@monika_26,

Try this: 

substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.RegistrationDate}),0,3)

Make sure you have the appropriate path for the registration date attribute.

Thanks, Sathees

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@monika_26,

Try this: 

substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.RegistrationDate}),0,3)

Make sure you have the appropriate path for the registration date attribute.

Thanks, Sathees

Avatar

Employee

This should be substr(toString(#{ExperiencePlatform.ProfileFieldGroup.profile.person.RegistrationDate}),0,4)