Appending data into Data table

Hi All,

I am working on a problem wherein i am fetching some data from web storing them in some variables and then creating a data table and then using the add data row activity adding the values into the data table.
The issue is that this process will run daily and write now what’s happening is that every time this process runs i am only getting the latest values in the data table so i guess the data is kind of getting overwritten instead of getting appended, is it because the add data row activity will not append if so what could be the solution for this?

Hi @shekhawat.arjun1307

Best way is at the start of workflow

Use read range to read the excEl file and store in datatable

Then use add datarow and them write it

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

1 Like

Hi @NIVED_NAMBIAR for this i need to have the excel file created already right? cause right now i am first creating the data table and the converting it to excel.

Better is u create an Excel file and then use it in read range

Because build datatable will build an empty datatable

So.better is read the excel u created and the add the data in it

It would be easier

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

okay so create an excel file store it in data table and then use append range, right?

No u can use write range too

But wouldn’t that over write each time?

I will sent a sample workflow so that u can understand it

Thanks

Hi @shekhawat.arjun1307

Check this workflow for sample
Main.xaml (8.5 KB)

Regards,

Nived N

Happy Automation

1 Like

Hi @NIVED_NAMBIAR

I tried with this workflow i am not getting any error but the excel sheet is not getting populated.

Hi @NIVED_NAMBIAR ,

In your workflow in the for each block you have added one add data row, i can add 3 data rows in there as well right, cause in one iteration i am fetching info of 3 people?

Hi @shekhawat.arjun1307

This is just a sample

What i am trying to convey is

when u are running ur process, it will read the excel file and store in datatable

then to that datatable we are adding the data row by row( means updating the datatable with new rows)

then after that we are using the write range to populate the updated datatable to excel

Regards,

Nived N

Happy Automation

Hi @NIVED_NAMBIAR

Can you check once what is wrong here.

Main (4).xaml (19.3 KB)

Hi Arjun,

If your excel file name is always same and you just have to append daily new data in that same excel file,

You can use Append Range activity. This activity will always append data to existing file.

Let me know in case of any question.

Regards,
Sahil

Hi @shekhawat.arjun1307
Check this workflow
Main (4).xaml (17.5 KB)

Let me know if it works for you

[Also create ur excel file with headers speciifed too ]

Regards,

Nived N

Happy Automation

Hi @NIVED_NAMBIAR

You have added only 1 add data row in the workflow when, at one go i am fetching 2 employees information which needs to be added in the excel, so won’t we need to add 2 Add Data Row activity ?

But it seems that u are using some get text activitiy only

Can u tell me how rows data’s are to be added

Like which which varaibles

So that I can modify the workflow for you

Attaching this excel sheet which will give you a better understanding.

y.xlsx (9.3 KB)

Here as you can see 3 record are dated today and 3 are dated for tomorrow. So i ran the workflow today and in the same browser page i am fetching the 3 records for today and saving them in different variables which then i am appending in the excel sheet as 3 different rows using 3 different add data row activity, tomorrow when i run the workflow i need to fetch the next 3 records.

Hi @Sahil_Garg1

I am capturing the data from browser and then saving them in the form of variables which i am using in the Add Data Row activity, I am not aware how to do that using append range activity, So can you help me here.