How to add data row without replace the first row? How to make it continue?

Hi Everyone…
I got a problem here about Data Table. The case is i try to copy a text from a page and add it to row with “add data row” and directly i add it to csv. And i do the same thing with same variable, but the result is it always replace the first row, that is’nt continue. If exist, Hopely you can share a file xml for more helpful :slight_smile:

Thanks.

@yosefgunawan
make sure you are appending to csv, not writing to csv…

Hi @AkshaySandhu … Thanks for your response :slight_smile:
I try to append to csv too, but it still same …

please upload your xaml file…

1 Like

Hi @yosefgunawan

You can use append to CSV or append Range after writing range to the same Excel sheet. Append Range works if you are using Excel application scope earlier and then writing and appending it.

https://activities.uipath.com/docs/append-csv-file

I have used Append Range below after writing it, so that it will continue from the next row:

1 Like

Hi @AkshaySandhu maybe there are which will u see in my project. I try to get 2 data, but it always replaced…


Hi @sonesh.bansal
Thanks for your response :slight_smile:
Is it making csv file? maybe u have an example in xml form that can u share here … Btw Thanks :slight_smile:

hello @yosefgunawan

Main.xaml (13.5 KB)

let us know if this helps you to build the logic for your process…

1 Like

Hi @yosefgunawan,

Please find xaml below. It is reading the content from excel, building data table, iterating through each row in the build data table getting row items, adding data row , writing and appending to CSV. It is working great and this workflow also contains filter data table activities which I have commented out, you can also practice that.

Note: Change the path of the excel and CSV which you want to use from your desktop

Forum Practise 1.xaml (17.9 KB)

I hope it clears everything, please let me know if you have any questions

1 Like

Hi @AkshaySandhu
It Fixed, Thanks a lot :slight_smile:

Hi @sonesh.bansal
It Fixed, Thanks a lot :slight_smile:

Hi I have a doubt with the same kind of… I already have a datatable dt1 (only 1 row will be having). using dt1… I am getting 2 values by doing some math where I have to add it to dt1 itself… On the other hand I need dt1 (1st row + current row). Any help would be appreciated

Hi Yosefgunawan, try to use Write Range (workbook) activity and in the properties panel use the Add Header option checked. That way your row 1 is never replaced. Else try to start from “A2” and that you can use a counter as well. For example “A”+Counter.ToString.

Set the counter initial value to 2 and then write assign - (Counter = Counter +1)