Issue in inputting values to List.ContainsItem node

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.

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

1 Like

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

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

1 Like

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.

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

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

1 Like

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.

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

1 Like

Here it is;

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

Alternatively use the “SpringsUI.Refresh” node from the SpringsUI package.
image

1 Like

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

I simply cannot replicate your troubles :confused:

1 Like

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 :slight_smile: )

2 Likes

That is a really good point @mellouze ! you could simply “count” the length of the strings
image

2 Likes

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 :slight_smile: :slight_smile: Thank you so much.

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

1 Like

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

1 Like

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

1 Like