For each row row number change

hi all
can i change row number of for each row?

when error occurs while running loop of for each row body, and let’s assume that row index is 4, i want to change row number to 4, not 5 using assign activity like rowIndex = rowIndex - 1 , so that next for each row’s body runs on row 4

is it possible?

Logically it is not possible because when we use for each row activity it gives each row one by one from start to end. But what you can do you can add try catch activity inside for each row in that case it will not stop the loop it will go to next row.

Hope it will work

An alternative is to use a While loop instead:

rowIndex = 0
while (rowIndex < DT.Rows.Count)
{
  row = DT.Rows(rowIndex)
  ...
  try
  {
     ...
  } catch {
     ...
     rowIndex = rowIndex - 1
  }
  ...
  rowIndex = rowIndex + 1
}
1 Like