# Getting elements if strings match

**URL:** <https://forum.dynamobim.com/t/getting-elements-if-strings-match/56605>\
**Category:** Revit\
**Tags:** revit\
**Created:** [October 26, 2020, 8:06pm UTC](https://forum.dynamobim.com/t/getting-elements-if-strings-match/56605 "2020-10-26T20:06:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalgirietis.minde](https://avatars.discourse-cdn.com/v4/letter/z/dbc845/32.png) [@zalgirietis.minde](https://forum.dynamobim.com/u/zalgirietis.minde)\
**Post date:** [October 26, 2020, 8:06pm UTC](https://forum.dynamobim.com/t/getting-elements-if-strings-match/56605/1 "2020-10-26T20:06:49Z")

</div>

Hi there!

I have a very basic node based version, but I can’t really solve it. I’m trying to get elements by comparing two parameters, but getting wrong boolean values.  
In this case from the list No.1 I need to get elements BR-12 and BR-13 which are in the list No.2, but getting false at index 2.  
What am I doing wrong here?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6e8230af2de43ba96c4c0a6b5cf999c5c5818777.png)

---

<div class="post-metadata">

**Author:** ![Bjorn\_Keulemans1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bjorn_keulemans1/32/54676_2.png) [@Bjorn\_Keulemans1](https://forum.dynamobim.com/u/Bjorn_Keulemans1)\
**Post date:** [October 26, 2020, 8:16pm UTC](https://forum.dynamobim.com/t/getting-elements-if-strings-match/56605/2 "2020-10-26T20:16:03Z")

</div>

You’re comparing 2 lists. The second item in list 1 is not the same as the second item in list 2, hence the False.

It sounds like you need a list.contains function to check if the values from list 1 are present in list 2, regardless of position,

---

<div class="post-metadata">

**Author:** ![zalgirietis.minde](https://avatars.discourse-cdn.com/v4/letter/z/dbc845/32.png) [@zalgirietis.minde](https://forum.dynamobim.com/u/zalgirietis.minde)\
**Post date:** [October 26, 2020, 8:23pm UTC](https://forum.dynamobim.com/t/getting-elements-if-strings-match/56605/3 "2020-10-26T20:23:12Z")

</div>

Looks like list.contains helped /w @L1 for List No.1.

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