Append Range duplicating data when using in for each

Hi
I am using append range after data scarping acivity in for each loop. The data is duplicating for each iteration.
I want unique data.

Hi @dineshsigaram,

after completing for each loop
Assign Datatable = dt.DefaultView.ToTable(true, “Column1”, “Column2”, “Column3”)
Regards,
Arivu

Hi

I hope You are suggesting to retrieve the distinct data from the table. I want to erase the persisted data in the datatable. So I used clear data table and it worked. Thank you.

Good idea dinesh.

Hey, I also wanted to mention that If you delete rows from your existing table, then use Append Range, it will keep all the blank rows where you deleted rows. So, if that ever happens, you need to perform a “Clear All” or “Clear Contents” (found next to the Format in Menu Ribbon) of entire range, followed by Writing the Existing table back on before Appending another table.

Discovered this recently and thought I’d share since it was related.

Hi @dineshsigaram,

So I confused. Yes you can use clear data table.

Regards,
Arivu

As per my understanding to your question you may need to use write range to append one data row at a time