Write data_scraping data into excel one below other

Hi,

Earlier you have shared your partial work flow which is very difficult for me to understand your 100% requirement so i have requested your full work flow so that i can modify and help you to resolve your issue. I understood you are unable to attach your workflow due to joined newly in the forum. thanks for your detailed screenshots below. i Understood your requirement now.

Please add the below steps to your workflow.

  1. Create counter and initialize to 1. Before Data scraping activity place one of condition to check if Counter = 1 then → don’t add any activity keep it empty and else → drag and drop clear data table activity and assign extract data table DT. it will help you to clear data table content in the extract data table DT for second run and further runs.

  2. After Data transpose activity use merge data table activity add source data table will be your extract data table and destination should be merged data table.

  3. Remove the write range activity inside loop and place the same activity in the outside of the loop and assign your merged DT as input data table so that once the loop ends it will write entire data into excel.

  4. After go back activity keep the Assign activity and increment your counter
    Counter = Counter+1 to increase counter for all the runs.

i hope you will get some help on the above steps to achieve your requirement. thanks.

Hi @kirankumar.mahanthi1,

I have made some changes in my actual flow and am able to do transpose without custom activity but here the data is overwriting on first 2rows when am running.
(I have invoked this flow inside foreach)
SAMPLE_TEST.xaml (25.4 KB)

when I run first time, 2rows will be written in excel.
when I run second time, only second row should be written from next blank row in excelsheet.
I am confused regarding mergedata here. could you pls check.
Thanks,
Mahi

Hi,

I am not sure we both are going on same page. Some of the activities i am not able to view since i am not able to resolve the namespace error for data manipulations. Based on my understanding i have created updated sample work flow. Please check and see if it helps your requirement. Sorry if i am not helping you much. thanks.

Updated.xaml (13.8 KB)

Hi,

Sorry but you have worked on a commented out sequence. I think you didnt check the complete sequence.

Hi,

Yeah. In my opinion the commented out work flow is good comparing to your recent workflow. Use custom activity to transpose and aquire some idea from my updated work flow. I am just sharing some help and logic on how to append data efficiently. Thanks.

Hi Guys,

@Jobin_Joy , @Robinnavinraj_S , @pravin_calvin

Some how myself and @Mahimahi meeting dead ends. I have already provided some suggestions. Could you guys have any suggestions on this requirement and throw some helping hands. Thanks.

1 Like

Hi,
I will check your updated workflow and get back to you with the results.

Thank you for helping,
Mahi

Hi,

Your most welcome. Any time. Please try and let us know. Appreciate your efforts on this requirement.

1 Like

Hi @kirankumar.mahanthi1

Can we use two data scrapping activities based on iterations like

if (index =1)
{
scrape both the columns(data scrapping )
}
if(index >1)
{
Scrape only column2 (data scrapping)
}
Thanks,

1 Like

Hi @Robinnavinraj_S ,

Thanks for your quick response. It is not fixed like how many times we have to use extract datatable since we are clicking some link and getting tables. The issue raised by @Mahimahi . Could you pls redirect your suggestion to @Mahimahi . Thanks again.

1 Like

Hi @Mahimahi

As @Robinnavinraj_S suggested, can you please try the above and let us know?

@kirankumar.mahanthi1 put lot of effort of this thread. Great :slight_smile:

Thank you.

2 Likes

Hi @kirankumar.mahanthi1,

I just implemented your flow. Am able to write the data using append from 2nd iteration.
But my concern here is I need to delete 1st row from 2nd iteration and only append 2nd row to excel. This is not happening.

Thank you,
Mahi

Hi @Mahimahi ,

Are you talking about headers(First row). Append range activity have inbuilt capability to ignore the headers. if you want you can delete the first row by using delete rows activity before appending the data. thanks.

Hi @sowmya.krishna ,

You have to provide row number under the position to delete the specific row. No of rows should be one of you want to delete only one row. Thanks.

Hi @kirankumar.mahanthi1,
I have already passed value 1 and its not deleting row.
Could you please tell how to pass value.
Thanks

Hi @Mahimahi ,

insert/Delete rows activity used to delete the row in the excel itself. do you want to delete the row in data table use remove data row activity in uipath.

https://docs.uipath.com/activities/docs/remove-data-row

We are little bit confusing whether @sowmya.krishna and @Mahimahi both are same. i replied to the above post since i thought it is related to delete rows in excel.

Hi @sowmya.krishna

I think you stucked with appending the data after each iteration!

Your Actual actual Process Up to transposing

After that Use Path Exists and write a dummy excel file name as below

Yourfull path with the file name C:\users\folder\Filename.xlsx

use if Condition and pass the out of the file exists!

If Exists Then Use Append Range with the datatable

Else use write range!

Regards

Hi @kirankumar.mahanthi1,

Maybe they are confused and wrote my name in their post.
I want to delete 1st row in datatable after datascraping (not in excel)and write remaining rows to excel.
I have used remove datarow and then used append range. The data is appending from 1st column. But I need data to be appended from second column. Is this possible.

I have attached a sample of excel. I am getting which have highlighted in yellow but I need data like it’s in blue highlighted color.

Thanks