Expand my Community achievements bar.

Adobe Journey Optimizer Community Lens 3rd edition is out!

Search an array in expression


Level 3



I want to check if a certain word is in the article name of an order, so I use the contain function. That works, only how do I check every position of the array? Because now it only checks position 0 as you see at the at(0). I want to check every position of the array, how can I do that in combination with this expression:

containIgnoreCase(@{ord_paid._company.igOrder.igEntries.at(0).igArticleName.igArticleNameNL}, "geldterug")
or containIgnoreCase(@{ord_paid._company.igOrder.igEntries.at(0).igArticleName.igArticleNameNL}, "aanbetaling")


3 Replies


Employee Advisor

@icostan2 ,

If you want to match arbitrary words, you have to programatically construct a RegExp (regular expression) object itself based on the word string and use test.

But, if you want to just find the characters, then you can use indexOf.


Level 3


Thanks for your reply and that you are willing to help me.


I don't think you totally understand me. If I use the Regexp, it still only searches at position 0.


Let me explain it again.


The contextual attribute for the article name is an array because you can order multiple products. I want to send everyone an e-mail with who has an article name that has the word 'geldterugbon' in it. 

When a field is not an array, I can do that like this: 

containIgnoreCase(@{ord_paid._company.igOrder.igEntries.igArticleName.igArticleNameNL}, "geldterug")

BUT, since the field IS an array, the expression looks like this: 

containIgnoreCase(@{ord_paid._company.igOrder.igEntries.at(0).igArticleName.igArticleNameNL}, "geldterug")


The bold part means that it only checks the articlename at position 0, so it only checks the first article you ordered. But also if the article is the 4th article in one purhcase, I want to send the e-mail. 

So I don't only want to check at position 0, but at every position. 


I can not simply remove the .at(0), that doesn't work because it is an array. 


This issue is quite similar and there the answer is to use the every function, but I don't think it works in this case. At least I have no idea how: https://experienceleaguecommunities.adobe.com/t5/journey-optimizer-questions/search-array-in-express... 


Hope someone can help since this is not very clearly stated in the documentation. 


@akshaaga maybe you can help? 



Hi @akshaaga,

Could you please help @icostan2 further here?


Sukrity Wadhwa