# Issue in inputting values to List.ContainsItem node

**URL:** <https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886>\
**Category:** Lists-Logic\
**Tags:** revit, excel, dynamo, list-filter\
**Created:** [August 16, 2018, 9:59am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886 "2018-08-16T09:59:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 9:59am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/1 "2018-08-16T09:59:54Z")

</div>

Hi everyone,

I am having a strange issue here by inputting List.ContainsItem node. I am taking values from excel file and giving it to List.ContainsItem node. But it doesn’t work. If I do it manually using a code block node then it works. Here, I am filtering rooms element ids based on the rooms numbers.

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

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 16, 2018, 10:03am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/2 "2018-08-16T10:03:56Z")

</div>

Haven’t you inverted your inputs in the **List.ContainsItem** node ?

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 10:05am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/3 "2018-08-16T10:05:10Z")

</div>

Also the issue is the object type… You need to know the difference between strings, doubles and integers 🙂 use Object.type node to see what types you’re using 🙂

you can use string.fromobject to change types to strings 🙂 put it after your values before your query

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 10:18am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/4 "2018-08-16T10:18:08Z")

</div>

Thank you for your quick reply. Yes, there was an issue to data type. I have converted it from double to string but still its not working. Both list values are of string type.

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

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 10:29am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/5 "2018-08-16T10:29:05Z")

</div>

See if this helps 🙂 It should show the logic behind what you’re trying to do:

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

To @mellouze’s point it can olse be done by flipping the inputs in “List.ContainsItem” node 🙂 Many ways to Rome 🙂

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

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

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 10:46am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/6 "2018-08-16T10:46:51Z")

</div>

Actually my **List.ContainsItem** node is not working; that`s the issue. It doesn’t show the correct output as i am using the correct data types.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 10:47am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/7 "2018-08-16T10:47:44Z")

</div>

Please show using the Object.Type node to verify your data types and all your previews enabled 🙂

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 10:51am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/8 "2018-08-16T10:51:54Z")

</div>

Here it is;

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

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 10:55am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/9 "2018-08-16T10:55:47Z")

</div>

That is very odd… Try restarting Dynamo and Revit… There might be something that hangs up your graph…

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

Alternatively use the “SpringsUI.Refresh” node from the SpringsUI package.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/e/be6b26bd9b33aa9b39c824a2fb42e338030df821.png)

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 11:08am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/10 "2018-08-16T11:08:48Z")

</div>

I have restarted it many times. When i manually give the values, it works. But from the excel file it doesn`t.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 11:22am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/11 "2018-08-16T11:22:53Z")

</div>

I simply cannot replicate your troubles 😕

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

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 16, 2018, 11:26am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/12 "2018-08-16T11:26:27Z")

</div>

Are you sure that neither of the inputs in the **String from Object** node are already of the string type ? It may be possible that one of them is already a string and that there is an extra space that we simply cannot see. (Just throwing random ideas, hoping it works 🙂 )

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 11:27am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/13 "2018-08-16T11:27:56Z")

</div>

That is a really good point @mellouze ! you could simply “count” the length of the strings  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/6/b67a9f659a9a49c647d08bdee3c9fcc0fb72af7b.png)

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 11:31am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/14 "2018-08-16T11:31:35Z")

</div>

Actually, the problem was in taking input from the excel file. I have used your way @Jonathan.Olesen to read the excel file and it worked 🙂 🙂 Thank you so much.

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

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 11:32am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/15 "2018-08-16T11:32:50Z")

</div>

Using “true” as the “readasstring” input in the excel node you can actually skip the “String from Object” node 🙂 as the data is already read as strings 🙂

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 16, 2018, 11:36am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/16 "2018-08-16T11:36:31Z")

</div>

The issue from before (using the other node) is quite clear 😉 As it read “doubles” the “String from Object” adds trailing zeroes to your numbers meaning that they do not match 😉

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

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

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 16, 2018, 11:40am UTC](https://forum.dynamobim.com/t/issue-in-inputting-values-to-list-containsitem-node/24886/17 "2018-08-16T11:40:26Z")

</div>

Yes, you are absolutely right. Finally i have done my task i.e. highlighting the rooms with the help of your answers 😉 Thanks a lot 🙂
