Dynamo Indexof givig "-1"

I don’t speak English. And I don’t know Dynamo either)

  1. I use TEXT PARAMETER.
  2. I’m going to bring in Excel and automatically input it through Dynamo.
    3.But INDEXOF produces -1.

EX)If the parameter S5_UTILITY is written as “SP” in the PIPE element,
The parameter SB_BLDG will be written as “DC”.
The parameter SB_FIELD will be written as “WATER”.

help me…


EXCEL

Hi,

Sometimes when you read an excel you get extra Whitespace you can’t see, perhaps it is that?

Hope that helps,

Mark

1 Like

image

Wold use this from Springs Package instead plug in elements in list and the values from your excel into value it will give you the index position of your elements
image

sry wrong n in my post node but here is the explaination. summerize index of is searching for an index position that contains both value FEG and SP and when it doesnt find an index position it returns -1 you want to use listallindices or the node i showed from my last post. that node will give you the index position that contains either of the values.

What version of Dynamo/Revit are you using? I’m wondering if this is a list levels issue. Your nodes are set to Shortest and you’re only getting on index back. Even if there was no match, you should be getting 2 or 4 indices returned in newer versions.

Can you try something like this?