IndexOf Node Issue (Returning -1)

Hello all,
Before posting i have searched the forum to try and figure out an answer as to why the indexof node was returning a negative one value or “no match”. I have verified to make sure both the item and list are string type. I have confirmed there are no “invisible spaces” in either string, but the 4 strings clearly match those found in the list. Any help would be appreciated.The intent of the script is to get to a point where i can place views on sheets.

1 Like

Hi @maxpauley,
Welcome to the Dynamo community.

That is because the lacing on your List.Index Node is set to Shortest.
Please switch it to Auto (if you are using Dynamo 2.0.2 or above)

Or to Longest and add the other nodes if you are using Dynamo 1.3.4


You need to set your lacing on the (List.)IndexOf node to @2 for the list and @1 for the item

1 Like

Yep, that did it. I appreciate that crazy fast response and the time you took to show me how to fix this.