Data scraping within For each loop does not overwrite but appends output

Based on an excel sheet I want to loop through all the rows in order to get the corresponding ID which is then used in a master data system.
After getting this ID and putting it in the system several documents are displayed - see screenshot:

All of them are checked for specific criteria and based on this criteria either saved or deleted.
The output of the first iteration is saved and the output of all further iterations are appended to the first data table.
But I want to have a separate data table for each iteration since no output is referenced to another.
How can I achieve that?
Thanks in advance for your help

Hi Marc, Can you reset the variable holding the ID as a first step in the for each loop?

1 Like

I solved the issue by using the Clear Data Table activity.
Thanks anyway :slight_smile:

1 Like

Should we consider it as a bug of Data scrapping?
Because Data Scrapping supports getting data many times from multiple pages, so it’s using append method, not overwrite like Write Range- i guest.
Should Uipath update it to clear data in the first run time?
There’re some risks if developer doesn’t know this requirement.

Hi @Doanh,

I consider it as a bug, but it’s that way from a very long time and I don’t think the behavior will change. It was intended that way for the cases when you don’t have a clear Next link, but rather page numbers. In this case, we avoid having to do the Append manually.

1 Like

How’s about one new option like “Append/Overwrite”- then developer can select manually?
I checked with my team, and not all of them know about this trouble :smiley:
When will work with web to extract data, to prevent error, we often put the web process into a Retry scope - so sometime the data in datatable be duplicated

1 Like

Thanks for the suggestion, @Doanh , I’ve added a note to our product team.

@Corneliu_Niculite FYI

1 Like

The form i found can to use Data Scraping in a For each loop without to bring the data from first page is to use the Clear Data Table Activity after each Iteration and to use here the Output data table from DataScraping, this form we can delete the data after iteration for overwritte