LookupDataTable returning incorrect RowIndex value


I am trying to get my robot to find an specific string variable inside a data table, and return the row number so I can write into other cells on the same row.
I’ve been using LookupDataTable, but I see that it is reading both the input and the pattern correctly, but the result (Rowindex) is incorrect:

If I understand correctly, the output value should be 2, since the pattern it is in the third row and it starts from zero, but the output is 1 instead.

This is how my activity is set:

can someone help me figure out where is the error? I do NOT have “Headers on” set in any of the other activities

MagicAccount1 is the column name and is not a value. The first row is D.MRSQL.04 which would be index 0, therefore the value you highlighted should in fact be index of 1

HI @Naelin

IT seems to me like that its considering the “MagicAccount1” as the column header. That’s why you are getting the loop index as one less than the expected. From where are you getting the value to this data table? From an excel? If so, make sure to uncheck the headers option so that every row in excel will be considered as a row once its in a data table.

Hi Lahiru, Dave,

Thanks for your replies. I was sure I removed “add Headers” from all my read range variables, but turns out that one from the input had in fact the headers option on. I removed it and it is now working. Thanks a lot!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.