Update existing row in existing excel sheet without using 'AddDataRow'

Hello Guys,

Can anyone help me to provide solution for below query?

I have a excel sheet with data and where I need to update few column values after filtering. Using assign activity I can update required column values but then I need to use add row which in this case not required so how can I achieve this?

Here is the example:

Input DataTable: MasterDT

Column1 | Column2 | Column3
UiPath | Studio | Community
UiPath1 | StudioX | Orchestrator

FilteredMasterDT by Column1=“UiPath”

Column1 | Column2 | Column3
UiPath | Studio | Community

Here I want to update value for Column3 in the FilteredMasterDT datarow but it should reflect in MasterDT, so how can I do this as I don’t know the row index of the given row in the MasterDT.

Also after updating the value for the given row of Column3, how it will reflect in excel as I did not add any row?

Need below output:
Output DataTable: MasterDT

Column1 | Column2 | Column3
UiPath | Studio | Academy
UiPath1 | StudioX | Orchestrator

Thanks,
Navneet :slight_smile:
Happy Automation!

1 Like

No need to use Filter Datatable
Just
Use if condition
In for Each Row
IF row(“Column1”).ToString=“UiPath”
Then
Row(“Column3”)=“Academy”
else (Here u can again add if condition if there are multiple)
Row(“Column3”)=“Orchestrator”

After For Each Row Use Write range (Note : Dont forget to tick add headers)

1 Like

Forgot to mentioned that, I am able to update the row but while writing to excel using Write Range with add headers, it not showing headers.

I am reading excel with headers which I have to do as its needed and after updating required column value and I am writing it. Here its not showing headers.

If you know the column name, then after you filter the data you can just read the cell addresses and replace the value with the new one, using a for loop for that column(in which you want to change the value) until you get the blank cell in that column.

1 Like

Try above steps hope it works for u
Or share your workflow i will check it

Sir,

I have exactly the same question. How to do this without using the Write cell activity ?
as I am very very interested to learn and know.

Very eager and hope full to hear from you soon.

Thank you in advance for advising me.

What is the scenario ?

While using the write range activity check the Add Headers check box.

Headers should get added.

Hi Teacher / Sensei (Robot Master),

Instead of not using the “Write cell” activity, can the “Multi Assign” activity be used ?

I tried it, with write range, it works but it does not update the last record of the Datatable.

I am still trying to find the solution for this.

Can you advise ?