Creating a summary sheet that updates based on each row of the data table it has ran through

I have a Flow which copies information from Excel to a DataTable (dtScrape) and it then carries out a series of instructions for each line (For Each row in dtScrape then do this etc.)

I’ve then created a new datatable with just the columns I need and an additional column saying ‘Status’

Then I have an assign which applies the word ‘success’ as it goes through each line

What I wish to do is as it goes through each line, for it to copy the entire row to a new Excel file.
But what is happening currently is that if there’s 10 rows of data it iterates through in the datatable, it’s copying all 10 lines to the new Excel file and not just the one line it is working on.

Any ideas guys?

1 Like

If u r using REFramework and if you have all the other columns filled and only that status column has to be filled the you can simply do with the assign activity if you have the TRANSACTION NUMBER And DATATABLE

like this

Dt.Rows(TransactionNumber)(“Status”) = “Success”

Here transaction will tell which row you are currently processing and this assign will tag value with transaction status

You can do this update in PROCESS STATE itself

Cheers @steve1977beyond

Hi @steve1977beyond

For Each Row in dtScrape
- Create a new DataTable (dtCurrentRow)
- Add Data Row (CurrentRow) to dtCurrentRow
- Write Range (dtCurrentRow) to a new Excel file
After successfully copying the current row to the new Excel file, you can update the “Status” column in your DataTable (if needed) to indicate “Success” for the current row.

Main.xaml (15.6 KB)
SalesReport.xlsx (9.8 KB)

Appreciate your help guys and I seem to have got it working. In this example it goes through each row in the Data Table and shows a Message Box.
Another Message Box stops it at the end to check the output and it seems to add incrementally which is good!

Actually it’s not working as this is what copies to Excel when I add an Append


I just want it to copy each line individually so given the master sheet has 3 lines, I want this to finish with 3 lines too. Any ideas guys?

This is the Flow now

…and this is what happens:

sorted it! What I added after the Append was a 'clear data table(dt3) activity.

Just use an Append Range after you process each row.