How to Filter Element Names by an Exact String List


I am trying to filter a list of elements by the name. There is a node for that, however it seems to filter based on if the search string is contained within the name. I want it to search the element list for names that match exactly like the search string. List Items 66 and 69 are good examples of what I am talking about. The string from object node output should match the first output watch node. as you can see it matches for most of it until it come to points in which there are more than one under the sublist. The Filter by Element Name outputs the first item in the list which works 90% of the time except for instances like this. For instance, List 69 has three sublist items under it. Item 2 is the correct one but is not the first one so it does not get picked. If I can figure out a way to get it to filter correctly then this step of the code will be complete.

A possible solution that I have come up with is to sort the sublist. However I do not know how to go about doing this. If any one have any other suggestions let me know.

I think you want the “==” node as below

1 Like

Thanks, will that work for list inputs as well. By the way, I think I tried this before but it seems that it slows my code execution down significantly. Had you have this issue before.

You might try this instead.

I have no way of knowing the complexity of your search to know if a specific node with affect the execution.

I will try this and report back. I been using the other string.contains that has three inputs and outputs a list based on first, in , and out.