# Get matching item from one list and set a corresponding value per a schedule legend

**URL:** <https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [June 7, 2023, 7:54pm UTC](https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491 "2023-06-07T19:54:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsayle](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/wsayle/32/125475_2.png) [@wsayle](https://forum.dynamobim.com/u/wsayle)\
**Post date:** [June 7, 2023, 7:54pm UTC](https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491/1 "2023-06-07T19:54:01Z")

</div>

I need to apply a value to a wire based on the panel that it is circuited to. The value is based off a schedule. How to search from one list to another and return the associated value?  
 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/0/102ad8efe6855946438f46fc17ed8cd71ffc4496.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/b/bba1c5af3cc5c3ad97260b4c620cfa1a4d776496.png)

 ![Script1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff86e98551d735dbf9601f1f338d2483591caabe.png)

I know that I am missing one or two blocks of code. I am trying not to resort to python. I am sure there is an OOTB solution here.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [June 7, 2023, 7:58pm UTC](https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491/2 "2023-06-07T19:58:24Z")

</div>

With the way you have your data already structured, the easiest solution would be a dictionary. The panels and associated values are the key-value pair that you can then lookup based on the wire value.

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [June 8, 2023, 1:02am UTC](https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491/3 "2023-06-08T01:02:20Z")

</div>

You could use List.Contains to filter and then index match to look up parameter value. Note lacing and list level on the List.Contains node

 ![ValueLookupAtIndex](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/efffaa0e8197fe3ebec0df2170151d143a379aa9.png)

---

<div class="post-metadata">

**Author:** ![wsayle](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/wsayle/32/125475_2.png) [@wsayle](https://forum.dynamobim.com/u/wsayle)\
**Post date:** [June 9, 2023, 12:33pm UTC](https://forum.dynamobim.com/t/get-matching-item-from-one-list-and-set-a-corresponding-value-per-a-schedule-legend/90491/4 "2023-06-09T12:33:10Z")

</div>

Thank you Both!
