How to add data in excel in REFW for each transection

Hi all,

I do have data which i am loading to queue form excel, For each transection i need to add the results in same excel Please let me know How can i add the data in excel in REFW.

Thank yo!!!

Hi @vineelag

In a UiPath ReFramework (Robotic Enterprise Framework), you can add data to the same Excel file that you are processing by following these steps:

  1. Add Column Headers if Necessary: If your Excel file doesn’t already have column headers, you should add them to the Excel file at the beginning of your process to define the structure of your data.
  2. Read Excel File: Use the “Read Range” activity to read the existing data from the Excel file into a DataTable. You can specify the range to read, or if you want to read the entire worksheet, just leave the range empty.
  3. Process Data: In your ReFramework workflow, you’ll typically have a loop (e.g., a For Each row) where you process each transaction. During this processing, you can add the results or new data to your DataTable as needed. For example:

’ Create a new DataRow with the same structure as the DataTable
Dim newRow As DataRow = excelData.NewRow()

’ Add data to the columns
newRow(“ResultColumn1”) = “Some result”
newRow(“ResultColumn2”) = “Another result”

’ Add the new row to the DataTable
excelData.Rows.Add(newRow)

  1. Write Data Back to Excel: After processing all transactions and adding the results to the DataTable, you can use the “Write Range” activity to write the updated DataTable back to the same Excel file. This will overwrite the existing data with the updated data, including the new results.

By following these steps, you can add the results of each transaction to the same Excel file you are processing within the context of the ReFramework.

Thanks!!

1 Like

can you share with me in a xaml for this logic

Thank you!!!