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.
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
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.
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!