How to add an event handler to UiPath.UIAutomationNext.Activities.NExtractData

Modern Design → Table Extraction.
When we indicate a ‘Next Page’ element to the Table Extraction wizard, the robot is able to navigate to next pages and collecting the data. We are using the output DataTable and saving the data, at the end of all pages,

Now, my need is to save the data before the robot moves to next page - Is there any way to do this?

If not, is it possible to hook a custom event listener ?

Thanks
Satya

1 Like

@satya.allamraju

Use Do While activity and inside that follow below steps.

  1. Use **Data Scraping to scrape the data from the webpage but don’t indicate next page navigator here.
  2. And then write the data into Excel file using Append Range activity and pass above Output DataTable to it.
  3. Use Element Exists activity and check Next page navigator exists or not and assign this Boolean output result to Do While activity condition.
  4. So that process will be repeated until next page navigator found. I.e Until last page reached.

Thank you Lakshman.

Hey @satya.allamraju

It is going to automatically have it in the data table variable ?

If you can explain a bit more on that please… the use case or the scenario.

Thanks
#nK

Hi Nithin,

I thought UiPath NExtractData will allow me to add an event handler for Next Page. But it looks like I need to use while loop + element exists logic. Could not get any other solution so far.

The need is that, if the Robot finds the desired data row after it navigates by one / more pages (in the data table), it should stop going further (i.e. Next Page logic should stop).

Thanks
Satya

1 Like

Hey @satya.allamraju

So here you are trying to find a table row and if that exist you are willing to end process.

You don’t care of the entire table being scrapped right ?

Thanks
#nK

Exactly. the desired row may exist in any page. Once found, I will stop the process. Entire table scrapping is not needed in this case.

Thanks

1 Like

Right, then you won’t need to use the extract data table instead you should use element exists with some loop if required.

Thanks
#nK

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.