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

IF Condition

Avatar

Level 4

Hi @Mohan_Dugganab @SatheeskannaK @Anuhya-Y 
i want to create a condition if any data  is not present in AEP for that attribute then IF condition should work and then and vise verse else should work

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@MYSTERIOUSMAN in addition to what was posted above -> if it is a profile attribute the "..." menu will allow you to auto-include a default fallback value 

 

the helper function to include a fallback value for any token: 

 

Hello {%=profile.personalEmail.name.firstName ?: "there" %}!

 

View solution in original post

7 Replies

Avatar

Employee Advisor

You can use the conditions on the following lines -

street4 attribute not populated
#{ExperiencePlatform.ProfileFieldGroup.profile.homeAddress.street4} is null

street4 attribute populated
#{ExperiencePlatform.ProfileFieldGroup.profile.homeAddress.street4} is not null 

Avatar

Level 4

I want to put this condition is if condition 

Avatar

Community Advisor

@MYSTERIOUSMAN Example condition,

if(#{ExperiencePlatform.ProfileFieldGroup.profile.person.nationality} is not null)
then (true)
else (false)

 

Refer to this documentation.

Thanks, Sathees

Avatar

Level 4

@Mohan_Dugganab @Ivan_Mironchuk @SatheeskannaK  Will this work in AJO email templete ?

 

Avatar

Community Advisor

@MYSTERIOUSMAN Expression which I have provided should work in condition activity in a journey. If you're looking for email personalization, use the function provided by Ivan or below.

Using the if function,

{%#if profile.person.name.firstName = "" %} {{profile.person.name.firstName}} {%else%} {{profile.person.name.lastName}} {%/if%}

Thanks, Sathees

Avatar

Employee Advisor

You don't have to put this in if condition as the expression evaluates to a boolean value which is what condition activity expects.

Avatar

Correct answer by
Employee Advisor

@MYSTERIOUSMAN in addition to what was posted above -> if it is a profile attribute the "..." menu will allow you to auto-include a default fallback value 

 

the helper function to include a fallback value for any token: 

 

Hello {%=profile.personalEmail.name.firstName ?: "there" %}!