# Use dynamic property to search for a value

**URL:** <https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111>\
**Category:** Data Transformers\
**Created:** [May 2, 2024, 1:15pm UTC](https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111 "2024-05-02T13:15:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brethren](https://forum.alumio.com/letter_avatar_proxy/v4/letter/b/9d8465/32.png) [@brethren](https://forum.alumio.com/u/brethren)\
**Post date:** [May 2, 2024, 1:15pm UTC](https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111/1 "2024-05-02T13:15:48Z")

</div>

Hi.

Im trying to look for an object based on a property value. Im trying to it this way but it doesnt work. Any chance i can fetch this dynamically without hardcording?

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

edit : “value”:“&{data[?@[0]== property]}”

doesnt work as well as it returns an empty array but when i hardcode

“value”:“&{data[?@[0]== ‘description’]}” it works

---

<div class="post-metadata">

**Author:** ![Rickvzanden](https://forum.alumio.com/user_avatar/forum.alumio.com/rickvzanden/32/247_2.png) [@Rickvzanden](https://forum.alumio.com/u/Rickvzanden)\
**Post date:** [May 3, 2024, 7:16am UTC](https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111/2 "2024-05-03T07:16:09Z")

</div>

I am looking for a similar solution.

How can we access a dynamic keyvalue and use that value as key selector from another array.

For example:

```auto
{
  "warehouse": "location4",
  "sites": {
    "location1": "3600",
    "location2": "3600",
    "location3": "3600",
    "location4": "1700"
  }
}

&{sites[&{warehouse}]} == "1700"

```

But the above unfortunately does not work.  
I also tried @brethren 's way finding a way to realise this with JMES path but no success yet.

Anyone that has an solution to our problems?

---

<div class="post-metadata">

**Author:** ![Gugi](https://forum.alumio.com/user_avatar/forum.alumio.com/gugi/32/236_2.png) [@Gugi](https://forum.alumio.com/u/Gugi)\
**Post date:** [May 3, 2024, 7:36am UTC](https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111/3 "2024-05-03T07:36:20Z")

</div>

Unfortunately, it is not possible to use a variable expander inside another variable expander.

@brethren could you please provide us with the test data for your case?

@Rickvzanden For your case, we can do the steps below.

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

In the above approach, you can format the source property in a similar format as the property in which you want to search for the value. Then, we can do a key intersection between the two arrays/objects, and the result should be an array/object with the intersected key.

---

<div class="post-metadata">

**Author:** ![Rickvzanden](https://forum.alumio.com/user_avatar/forum.alumio.com/rickvzanden/32/247_2.png) [@Rickvzanden](https://forum.alumio.com/u/Rickvzanden)\
**Post date:** [May 3, 2024, 7:50am UTC](https://forum.alumio.com/t/use-dynamic-property-to-search-for-a-value/1111/4 "2024-05-03T07:50:17Z")

</div>

@Gugi  
Thank you for the quick reply and solution!  
This was very helpful.

Any chance a variable inside a variable could become a feature in the future? Although this works fine, it looks a bit inefficient.
