How to store all the data using write range when I am trying to add new data it's replacing old data

I am storing details using datarow and add datarow activities


Pls someone help me in this

Hi, try using Append Range instead of Write Range activity.

It’s removing column names if I use append range and also Its entering same column with different row. I need to store based on dates

I need data like below image with based on user input


I written like this using if comdition

In the data row property
Instead of data row
Pass your row to array property by
Rowname.itemarray @kavitha_chavala

Hi, @kavitha_chavala

It can be help to you.

The image shows a workflow for adding data to a DataTable and writing it to an Excel file using UiPath. (Captioned by AI)

Example:
Data.xlsx (10.3 KB)
Main.xaml (19.1 KB)

@kavitha_chavala

I feel build datatable is present inside for loop

please move it outside the loop

cheers

I did not use for loop even

@kavitha_chavala

okay then ideally you need to use append range if old data should not be overwritten

or in write range when already data is present…first read data …coutn rows and then add write range leveraging the count and adjusting the range property

cheers