Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
SOLVED

Return email from list of emails of a profile

Avatar

Level 5

Hi, I’d like to use a condition within a journey to filter profiles based on email domains, specifically emails with the domain @asd.com from the email object.

For example, if a profile has the following emails: [a@asd.com, b@bsd.com, c@mgh.com], I want to ensure the journey only sends emails to those with the @asd.com domain.

How can I achieve this using advanced expressions in a condition?

I’ve tried an approach, but it seems to be returning all emails associated with the profile rather than filtering for the specific domain.

 

Silvio6_0-1737567032909.png

 

Thanks

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

SOLVED With this expression I return the desired email domain from the profile's email list Object:

#{ExperiencePlatform.ProfileFieldGroup.profile.identityMap.entry('email').first(containIgnoreCase(currentDataPackField.id, 'adobe.com')).id}

View solution in original post

9 Replies

Avatar

Level 5

.

Avatar

Community Advisor

Hello @Silvio6 try this?

 

matchRegExp(serializedList,'.*@asd\\.com.*' )

 

 

~cheers,

NN.

Avatar

Level 5

mm that's not working bc it's returning a boolean and I want to send email to "a@asd.com" from [a@asd.com, b@bsd.com, c@mgh.com] using a kind of contain function.

 

I mean, I want to return from the whole funcion the "a@asd.com" email

 

Thanks

 

 

Avatar

Level 5

any help?

Avatar

Employee
This should work:
 
count(#{ExperiencePlatform.ProfileFieldGroup.profile.identityMap.all(
contain(currentDataPackField.email,"@asd.com")
    )}) > 0
 
The all() function will return any listObjects whose email address contains the substring "@asd.com".  I used the "count() > 0" wrapper because listObjects aren't supported in conditions; they need a boolean.
 
Just make sure the syntax before the .all() matches your path to your array (I took a guess based on your screenshot), and that the email field is also the correct variable name. 

Avatar

Level 5

thanks! but I need the string value, for example, "a@asd.com", not a boolean.

 

The use case is that I need to send that string to Slack using custom action, that's why I need the exact value and not the boolean.

 

 

 

 

Avatar

Employee Advisor

You can use the following expression to filter those profiles that have 'asd.com' as the email domain value

containIgnoreCase(serializeList(#{ExperiencePlatform.ProfileFieldGroup.profile.identityMap.entry('email').id}, "|", true),'@asd.com')

 

Avatar

Level 5

Thanks! please take a look to my response to ZoeKi.

Avatar

Correct answer by
Level 5

SOLVED With this expression I return the desired email domain from the profile's email list Object:

#{ExperiencePlatform.ProfileFieldGroup.profile.identityMap.entry('email').first(containIgnoreCase(currentDataPackField.id, 'adobe.com')).id}