# List.ContainsItem

**URL:** <https://forum.dynamobim.com/t/list-containsitem/14379>\
**Category:** Revit\
**Created:** [August 29, 2017, 11:34am UTC](https://forum.dynamobim.com/t/list-containsitem/14379 "2017-08-29T11:34:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sofmal](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sofmal](https://forum.dynamobim.com/u/sofmal)\
**Post date:** [August 29, 2017, 11:34am UTC](https://forum.dynamobim.com/t/list-containsitem/14379/1 "2017-08-29T11:34:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c44258f2325d50e5af16dd7abc608d721b236e2a.jpg)

I am trying to compare two lists with different lengths. I want to find which items that exist in both lists. I use List.ContainsItem but it does not work. Any ideas of what I am doing wrong? I also tried to do a Python script but the result is the same.

---

<div class="post-metadata">

**Author:** ![T\_Pover](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/t_pover/32/19147_2.png) [@T\_Pover](https://forum.dynamobim.com/u/T_Pover)\
**Post date:** [August 29, 2017, 12:03pm UTC](https://forum.dynamobim.com/t/list-containsitem/14379/2 "2017-08-29T12:03:04Z")

</div>

The Lunchbox node does not output an integer but an actual ElementId.  
Try using the Element.Id node like this instead of the lunchbox node output:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/324d8bda43b6780c681614da56d000230566501a.png)

---

<div class="post-metadata">

**Author:** ![jostein\_olsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jostein_olsen/32/8570_2.png) [@jostein\_olsen](https://forum.dynamobim.com/u/jostein_olsen)\
**Post date:** [August 29, 2017, 12:08pm UTC](https://forum.dynamobim.com/t/list-containsitem/14379/3 "2017-08-29T12:08:59Z")

</div>

Try the BuiltIn node SetIntersection

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/b/5bd576c610408f446519fcbd060b53f76b249da7.png)

---

<div class="post-metadata">

**Author:** ![sofmal](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sofmal](https://forum.dynamobim.com/u/sofmal)\
**Post date:** [August 29, 2017, 1:12pm UTC](https://forum.dynamobim.com/t/list-containsitem/14379/4 "2017-08-29T13:12:42Z")

</div>

Okay thank you. I did like that and then it worked 🙂 great!!

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 30, 2017, 6:41am UTC](https://forum.dynamobim.com/t/list-containsitem/14379/5 "2017-08-30T06:41:10Z")

</div>

Hi, there is also a very useful package called **If Equal Return Index** , does exactly what is says if that might be useful.
