Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit is happening now. Discover what's next in customer experience.

How does the contain function work?

Avatar

Level 2

Hi,

 

I want to check if the word 'POST' comes back in a contextual attribute: {{context.journey.events.00000._company.igOrder.igEntries.CarrierUid}}

 

So I want this:

 

If {{context.journey.events.00000._company.igOrder.igEntries.CarrierUid}} contains the word 'Post' ( not case sensitive), I want to show: "Post bezorging" in the e-mail.

 

I know how to use the if statements, but the documentation is totally not clear about how to use the contain function. 

 

Can someone help me with this?

 

Thanks!!

5 Replies

Avatar

Community Advisor

Hello @icostan2 

 

You can do it like this.

 

{%#if(contains(context.journey.events.00000._company.igOrder.igEntries.CarrierUid, "post", false)) %}
If field containss post print something
{% else %}
Post not found in the field
{%/if%}

 

More info on function is available here: String functions library | Adobe Journey Optimizer

 

Avatar

Level 2

Hi, I tried these two ways, but they don't work. Do you know how else I could try it? Thanks for your help! @Manoj_Kumar_ Schermafbeelding 2023-03-22 103943.pngSchermafbeelding 2023-03-22 103838.png

Avatar

Community Advisor

@icostan2 remove the single quote around the event id

content.journey.event.'816428911'

Avatar

Community Advisor

Just tested it. That won't work either.

 

It seems all these functions are designed to work independently. If we wrap them within other functions they are not working. 

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now