# Compare value with an array list of values

**URL:** <https://forum.alumio.com/t/compare-value-with-an-array-list-of-values/1584>\
**Category:** Data Transformers\
**Tags:** data-transformer\
**Created:** [January 21, 2025, 1:57pm UTC](https://forum.alumio.com/t/compare-value-with-an-array-list-of-values/1584 "2025-01-21T13:57:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g.nikolian](https://forum.alumio.com/letter_avatar_proxy/v4/letter/g/e36b37/32.png) [@g.nikolian](https://forum.alumio.com/u/g.nikolian)\
**Post date:** [January 21, 2025, 1:57pm UTC](https://forum.alumio.com/t/compare-value-with-an-array-list-of-values/1584/1 "2025-01-21T13:57:06Z")

</div>

Hello,

Let’s say I have retrieved an entity from one system that looks like this:

“LineNumber” : “”  
“ItemNumber” : “1234567”  
“PurchaseNumber” : “”  
“items\_with\_sn”:[  
0 : “1234567”  
1 : “ABCDEFG”  
2 : “AA11BB22CC”  
]

I want to compare the value of “ItemNumber” with the values on the “items\_with\_sn” array list, and if there is a match I want to create a key with the value “match” otherwise the value should be “no\_match”.

How can I achieve this dynamically without having to hard code the values of the array?

I have right now the below conditional formatter

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/1/16195fd690dd72ff38534b4364c1d78d986af320.png)  
but I don’t want to type the values, in the future they could be changes.

Thank you

---

<div class="post-metadata">

**Author:** ![m.arief](https://forum.alumio.com/user_avatar/forum.alumio.com/m.arief/32/1568_2.png) [@m.arief](https://forum.alumio.com/u/m.arief)\
**Post date:** [January 22, 2025, 7:52am UTC](https://forum.alumio.com/t/compare-value-with-an-array-list-of-values/1584/2 "2025-01-22T07:52:14Z")

</div>

Hi @g.nikolian ,

You can try creating a “ **Value Setter** ” and applying the JMESPath “ **contains** ” function to the value, as shown below:

> &{contains( **items\_with\_sn** , ItemNumber)}

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/9/922fb661874b252e8a261b8399facb4579f3d0e3.png)
