Data Scraping producing "Object reference not set to an instance of object"

I am trying to click each of the text/name fields from a specific page (then perform actions after each click) on a website called telegram:

So I tried using the UI Explorer to see if there were any patterns in the selectors, but I couldn’t find any.

Then I decided to use the “Data Scraping” tool. In which I set it up to only scrape the text fields
However, when i try to perform any actions with the data table that contains the information I get the error “Object reference not set to an instance of object”

Does this mean that my data scraping is not working?
If yes, why, and how could I set it up to work?

Hi @Sami_Syed ,

“Object reference not set to an instance of object” means the datatable you need has not been initialized , in other way it means your data scraping is not working.

And sorry I cannot access to the website and give a try…

Thanks,
Aisling

1 Like

Any ideas on how I can get it working?

Hi @Sami_Syed

After Data scraping in Preview are you getting any data. If yes can you please share screen shot.

Regards,
Vijay

1 Like

Yes I am getting all the data I need in the preview:

Hi @Sami_Syed

If you are able to fetch data in preview it should give data. The output variable datatype should be a DATATABLE - just check. If possible can you please share xaml file or selector inside the respective activity.

Regards,
Vijay Kumar C.

1 Like

I managed to solve that problem, instead of using a data table I found a value in the selector which I could increment. SO that problem is now solve. Thank you!

But anyways, now I am using a data table for something else, scraping usernames and storin ginto data table for later us. But I am now getting this error:
9784f6d2a61ce33f120c7f400f97264137a189c1
What does it mean?

1 Like

Hi @Sami_Syed

form the screenshot i got to know that “usernameCoulmn” is alerady contain "@martininNN’.
I think while using Build Data table activity to create data table you should have checked Unique Check box which won’t allow any duplicate values in to that column.

Please un-check it and i think it should work.

Regards,
Vijay Kumar C.

1 Like

This is not possible because each time the process runs, a brand new data table is created.

I do not see this option

Maybe the way I set this up is the problem
Capture
???

I should also mention that it works compeltely fine on my computer, however when send it to my Virtual Machine, which also has UIpath downloaded, only then it throws this error.

I have uplodaed the file. Please take a look for me.
The sequence “get member username” contains the “add data row” activity which is causing problems.
Main.xaml (58.4 KB)

Uncheck the Unique option in the Build Datatable properties.

There is no unique option. Please look at the screenshot I sent

Click the DataTable… button in the Build Data Table activity.
Then edit the columns.
unique

The unique checkbox should be unchecked.

I see what you mean, but either way the data coming into the data table from the “add data row” is different every time. But for some reason UIPath is thinking its duplicated when it’s not. You could even check my logic.

So if UIPath thinks its duplicated, when its not, it will not add be adding the data to new rows anyways
You see what I mean?

And like I said the error only comes up on my other computer for some odd reason…

sami
I don’t see anything wrong with the workflow you uploaded. Just this one.
If you tried it unchecked and it is still not adding a data row, it is really odd

Its now giving this error: 242e5bc7cd5d4e7d3d2eac9ee2b4d0f4e0eb82a7

Hi!

You should check if the nunber of columns of the datatable is same as the number of inputs you will add. Thanks

how do i check that?

In the Build Data Table activity, check how many columns you the datatable has.

Then in the Add Data Row activity, check how many inputs you are passing. For example, {“test1”,”test2”}. The ArrayRow contains two objects.

So the datatable you have from the Build Data Table activity should also have 2 columns.

Thanks and best of luck

I got that error to go away.

Now there are no errors but now when the add data row happens in a loop, the table outputs nothing (meaning its empty). This takes us right back to this issue:

Another thing I want to mention again, is that this exact workflow works perfectly without any problems on my other computer, for some reason it is causing problems on this computer??

Strarted a new topic for this: Datatable "Constrained to be unique" error