Going Through Datatable

I have attached datatable and xaml. I’d need to catch every third column value from each row (10 digit values). Currently i can read first row and robot crashes cause i’ve not figured a proper limiter to columncounter. Main.xaml (25.6 KB)TestExcel.xlsx (21.1 KB)

1 Like

For the rows loop, you dont need to use While, it is easier to use For Each Row, also for the columns are they dynamic? if you know the index of the column you need, then use directly in the type into: row(3).tostring for example…

1 Like

Yup, columns are dynamic. I’ve gotten pretty close using while inside for each… :slight_smile:

ok, then maybe change this:
dtAccessoriesParts.rows(rowcounter) to just row
and this countRowsPartsList>0 to countColumnsPartsList>=0
and put assign countColumnsPartsList = countColumnsPartsList -1 in bottom of While

1 Like

Thanks, i’ll try these modifications and let you know.

Made changes it is still running first row ok and ends to Type Into ‘panel’: Cannot find column 30…

So, what you want to do is loop the rows and inside each one you want to loop all columns? or not all columns?

I wanna go through the table and every third column value(10 numbers) is inputted in a separate sequence to terminal based AS400 system. It works totally ok first line but crashes “Write Line: Cannot find column 30”. I figured that probably i’ll have to delete empty rows/columns from a datatable before entering loop…

you mean you want row(2) then row(5), row(8)… like this?

Actually from each row column(0),(3),(6) etc. After all columns in a row we’d switch to row2 and continue till the end of the table…

you access a column value using row(0) which is the first, the third would be row(2), the sixth row(5)…

Yup but the trouble here is that i have to input all the values to terminal from each row before moving to row2. This must be the order of execution. If i throw row(2) to loop it picks value from row and then again same column from next row…

Solution: It was actually smarter to do double Split. First whole datatable with newline to get the rows. And after this Split rows. With counters i am able to go through whole datatable nicely… :slight_smile:

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