Compare list words in another list

I try to compare keywords from one list to another but with the node string.contins does not work. Which other option could I use for the solution of this problem? Thank you!


Translated by admin - original text below the line.


Intento comparar palabras claves de una lista a otra pero con el nodo string.contins no funciona. Cual otra opcion podria emplear para la solucion de este problema. Gracias!

Please keep all posts to English. You can use an online translator and post the original text as well, but we need the English to keep search working.

Try setting your lacing to cross product as a first step.

What was the reason you created a list after the room.name node? Doesn’t seem very logical to me because your data already is put in a list by the room.name node…

What other option could you use for this problem?

It’s just a way to have the code organized. I do not think it’s important to have the list.create in this step.

I would use String.Contains with cross product lacing, then perhaps a List.Contains at level two looking for false if needed. Then a List.FilterByBoolMask if needed.

1 Like

Agreed, in the example shown list.contains only compares the same indexes and not item 0 in room list with item 0 to 9 in the name list as hoped for. Cross product lacing will fix this.

Hope this makes things clearer.

It does not work and they are also two different lists since one is from rooms and the other is from a CSV file

I’m getting the sense that the data from CSV isn’t in string format. i could be wrong though. Could you check the data types by placing the ‘types’ node behind the bottom ‘flatten’ node or zip the files and upload them?

It does not work.

Double check your lacing - nothing you’ve shown has used cross product lacing so far.

An example in action:

1 Like

It has not yet managed to work. All the results are false

You’ve have your lists backwards. You’re searching your keywords for room names instead of the other way around.

I already tried it in the two ways and I still get everything wrong

Can you try to explain in more detail what you’re actually trying to achieve here? You want to check you room names if they contain ANY of the words from the CSV?

I think this is what you are after. As @Nick_Boyts noted your inputs are reversed. Also there likely is no reason to have the String.Split nodes involved.

I have a room list that I should compare to a csv list. If the words are equal between the two lists then the result is true, otherwise compare it with another list

I have a good knowledge in dynamo and revit I have tried many forms and one of those is what you just showed me and it does not work either