この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
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!!
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
Hi,
Thanks for all your help!
It turned out that the field was an array, so I have to use the each function first. Did that and then it worked 🙂
Hello @Taal
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
Thanks @_Manoj_Kumar_ I am going to try this!
表示
返信
いいね!の合計
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_
表示
返信
いいね!の合計
@Taal remove the single quote around the event id
content.journey.event.'816428911'
表示
返信
いいね!の合計
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.
表示
返信
いいね!の合計
Maybe try this? single quotes and little change in format.
if contains({{context.journey.events.00000._company.igOrder.igEntries.CarrierUid}}, 'Post') {
// email
}
表示
返信
いいね!の合計
Hi,
Thanks for all your help!
It turned out that the field was an array, so I have to use the each function first. Did that and then it worked 🙂
表示
返信
いいね!の合計
Sure!
Note that the field that I use is an array, so if your field is not an array, you should not use the 'each' part:
{{#each context.journey.events.xxxxxx._company.igOrder.igEntries as |entry|}}
{%#if contains(entry.CarrierUid, "post", false) %}PostNL{%else if contains(entry.CarrierUid, "zzz", false)%}zzz{%else%}
External {%/if%}
{{/each}}