Trouble looping datatable


Can someone point to me what is wrong in my workflow? It’s working fine until it stops in the middle of the datatable telling “For Loop Row: Index was outside the bounds of the array.”
Attached is my XAML and excel source data. It’s printing excel- columns to write line at the moment for debugging purposes…

Thanks in advance!
Flowchart.xaml TestExcel.xlsx (26.7 KB)

@Mikko_S That error occurs mostly when you try to access an Index out of the Array, Like If an Array contains 4 items and if you try to access the 5th item.

Had a hunch it might have something to do with this. Trying to figure out how to use lists then with this… :slight_smile:

Can you please explain the requirement ?

Sure. I am inputting this data to AS400 terminal mainframe. single order is one row and i input each time 3 first values like “Column A + Column B + Column C” next one D,E,F and so on. When we reach end of the row we reset counters and continue. Customer id is fetched from same excel file from another sheet.

Can you test the below code and verify the result.
Please update the excel path in the code.

Sequence1.xaml (8.3 KB)

Nice try but this one does not go systematically each row. I actually started building too with straight on for- loops but hit the roadblock. Splitting datatable seems better approach for now. Thank you anyways! :slight_smile:

so you want to process all rows under A,B,C columns and then got to DEF columns form first row to end ans so on ?

First we want all the values from 1st row like columns ABC, then DEF etc. After fetching these we move to next row and continue…

Okay. I have attached a zip folder, In the excel file verify the Sheet1 where the bot pasted the data. is it the way you output should look.

if yes,please open the Sequence1.xaml and provide your excel location (in Read Range and write range at the end) and test it (29.4 KB)

This works exactly how was planned thank you! :slight_smile:

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