Issue : There is no row at position -1

System.IndexOutOfRangeException Exception Message: Unhandled system exception occurred. Following are the details: There is no row at position -1.

Hi, in what activity you are seeing this error?

Assign Activity

sorry, but we will need more details than that…

even i am getting the same error in assign activity
row.Item(“colname”) = dt2.Rows(intRowIndex).Item(“colname”)

in each row , i used lookup activity and trying to update that value in data table

Hello, I have the same issue, if this issue was resolved?

Hi @roger.nunez.montero

welcome to forum

The error occurs because there is no rowindex with value -1 , rowindex always starts from 0.

If u are not getting the value in datatable using lookup datatable activity, then the rowindex will be -1, which means that there is no such value in datatable in the specified column.

So after this if we use, dt.Rows(rowindex), it will give u error.

so to handle this error , u an if condition with condition as rowindex<>-1, if the condition is true then there is value in datatable so u can use dt.Rows(index).

But if the condition is false, then u cannot use it.

Hope the above information help you


Nived N

Happy Automation


Thank you. This resolved the issue