Datatable - Retain values for daily run

datatable
excel
activities
studio

#1

Hello Everyone,

I have an excel sheet as shown below

But I am looking to modify it as shown below

As you can see, I am trying to add a new column(“View”) to the datatable and each row of column view has a set of values which will repeat every day when I run the script.

Please note that I will be running this script daily to append data. So currently the screenshots has 3 rows for today, but tomorrow it will be 6 rows

How can I do this? I can add a new column with default value for each row but how do I approach this scneario

Thanks
Selva


Invoke Method - Despite declaration, column name missing
Excel is Empty but DataTable output is blank when queried for rows count
Datatable.rows.count returns blank output
#2

Hi @Selvasathappan,

You can approach this Scenario as below:
Create a Excel File “Output” with “View” Column (If not created).
Read the Excel File without View Column.
Add Column “View” in DataTable.
Append the DataTable in the Excel File “Output”.


#4

@Santan_Barnwal, Fixed this using merge data table and append range activities. Thanks for your prompt response. Appreciate it


#5

But how do I avoid headers while appending data? Every time, it appends the headers as well. There is no “Add Headers” option to disable as well


#6

To avoid repeat.
First create a new excel/csv file.
Then you ll need to use new datatable (with View column) to append the data to excel/csv and clear the same datatable after each append activity.

To avoid headers in consecutive runs:
check if the new file exists, if yes use append activity. if no, create file with headers.


Excel is Empty but DataTable output is blank when queried for rows count