How to iterate a data table?

Hello,

I want to loop a unique data table like this one:

1
2
3
4
5
6

When number 6 is reached, I want to obtain the value 1 and so on.

Also, when a value is reached, I want to obtain the value of the next one (if the value is 3, I want to obtain the value 4 and when the value is 6 I want to obatin the value 1)

Thanks a lot.

Do you want to loop indefinitely?

Use the below code inside for each row.

  • Assign previousValue = Datatable1.rows(Datatable1.rows.indexof(row)-1).item(“ColumnName”). tostring

  • Assign NextValue = Datatable1.rows(Datatable1.rows.indexof(row)+1).item(“ColumnName”). tostring

1 Like