How to get all the row item of data table at one time

I I have a datatable dt which contains two columns . I am iterating through for each row and have item values as row.item(0) and row.item(1)

But actually I want to store all the all the row item values at one time
like for row1 , row2
here I have only two columns and rows are undefined and need to get all the rows items at one go
Please help

Hi @Karan28,
Why do you need all of rows and items at one go? You can just iterate through all rows using For each row activity and define actions for each row. For example if you want to use data inside each element for each row and save it as variable you can do something like this:

Hi @Pablito

I need to get all the items at one go because I need information from the second item while processing item first.

for example.

row.item(1)=B16 - for first iteration
here to process next steps in the first iteration of for each row I need information of i.e D16 of row.item(2){of second iteration} too

row.item(1) = D16 for second iteration

define a variable for the for each row output index (e.g. idx)
with yourDataTable.Rows(idx +/- Offset)(YourColNameOrIndex) you can retrieve values from other rows.
But you should handle the cases where this logic risks to jump over the borders (e.g. first, last row)

1 Like

Its not working , could you please explain a bit more

find starter help here:
ForEach_AlsoNextRowIndex.xaml (8.3 KB)