Trouble in Append Range

Hello guys so i have activity append range from sheet 2 to sheet 1. But when i do append range, the data that append to sheet 1 have double data. Example on sheet 2 have 2 rows, when i append to sheet 1 its became 4 rows

Did u guys know why it can be happen like that?

Hi,

Can you share your project and/or screen shot of the workflow and sheets?

Regards,

Sorry i cant share it here. But do u know why is it possibly happened?

Its not possible, may be you have ran 2 times or two times you have append into sheet1

Regards,
Arivu

HI,

In my environment, it seems to work well.
Can you try the following sample? Is this same with yours?

Sample20221114-2.zip (9.3 KB)

Regards,

image
I have flow like this for the append range

@Kelvin1
Most likely you have run the project twice. Every time you use append the data will be added to the end of the sheet (appended).

If your sheet2 has 2 rows:
image

And you run the project 2 times, your sheet1 will look like this:
image

Likewise, if you’d run your project 4 times, the outcome in sheet1 would be like this:
image

Each time you run the project, the 2 rows will be added to sheet1.
Try clearing sheet1 and run the project again, once. The outcome shoul be only the 2 rows from sheet2.

HI,

Do you write dtFinal to Sheet2 next re-read it from Sheet2, then append it to Sheet1?

Why don’t you append dtFinal to Sheet1 directly?

Regards,

Hi @Kelvin1
Are you trying to use write range of workbook in an excel activity scope . Instead you can use write range to excel as well. May be that is creating a issue. Please try using another write range

And alao you need not read the data from sheet 2. You can directly pass the same dt to append range as well

Cheers

Hi @Yoichi @Anil_G i already pass the same dt to append range, but the issue still didnt solve. I still have double data output. I dont know why this thing happened, because when i check the sheet 2 its only having 2 rows but when i did append range to sheet 1 its became 4 rows

Hi @Kelvin1

Please print your dt using output dt before using append range to check if there are 2 or 4 rows and also please check if the sheet 1 you are trying to paste is empty or not…may be you can use a read range on sheet1 as well to see what data is present

Cheers

@Yoichi Hi, i want to use remove duplicate range activity is it possible to solve this problem? then i want to ask u how much max range in excel that we can input in range

Hi @Kelvin1

For remove duplicates you can do a count on your rows and pass double the values as you see that the range is doubling

Cheers

Hi,

RemoveDuplicate Range might work. However it’s not good in case that there are duplicates in original data.
For now, can you try to set breakpoint at WriteRange, then debug run and check content of dtFinal at LocalsPanel when it stops there?

Regards,

Hi @Yoichi
I already did that, and the localspanel show only 2 rows. So what i have to do next?

Hi @Kelvin1

Is your sheet1 having data already? Can you confirm that as well

If not pass the range to remove duplicate rows by getting count of rows dt.rows.count

Cheers

hi @Anil_G

Which sheet are you talking about?

Hi @Kelvin1

I am talking about the sheet to which ypu are trying topaste the data

Cheers

hi @Anil_G , yeah i have data already in my sheet1