findIndex of a string

I’m trying to find the row of a cell in a specific column that coints the same data I am passing, it should be a string. Alredy tryied to use getDysplayValue in the definition of nomeVenditore, it dosn’t work. I don’t have any clue of what the error is about, the argument in the method findIndex is underlined with red.

var nomeVenditore = scadenziario.getRange(eRow,13).getValue();
var colonnaVenditore = 8 //for example

var arrayVenditori = pnl.getRange(5,colonnaVenditore,5,1).getValues();
var rigaVenditore = arrayVenditori.join().split(",").findIndex(nomeVenditore)+5;

pnl.getRange(1,1).setValue(rigaVenditore);

It always returns -1 + 5 = 4

61 thoughts on “findIndex of a string”