Expand my Community achievements bar.

Adobe Journey Optimizer Community Lens 6th edition is out.
SOLVED

IF Condition

Avatar

Level 4

Hi @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

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

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

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

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" %}!