Handle NULL values with data scraping

datascraping

#1

I have built a simple workflow to extract data from a website. Using the Data Scraping tool I have identified elements to be extracted. Some elements are however not always present. So by running below workflow I get an error: “object reference not set to an instance of an object”. I assume it has to do with the missing element in some cases. Is there a way to handle null values in case elements are not present?


#2

@Gitiyboy, please Check element Exist or image exist first before doing the extract,

other wise you could check on the Data table row count is 0.

let me know if that helps,

Thanks~Rajesh


#3

@rajeshprabhu_gp

sorry for the late reply. I am new to UIPath so i am not sure what you mean. See below for my workflow. Sometimes an element does not exist. In that case I want to get NULL for that element, but now i get an error.

Could you please help?


#4

@Gitiyboy

have If activity to check Datatable (Eindhoven) row count is > 0 then write csv else its null.

some thing like below in IF Criteria
Eindhoven.rows.count > 0

Thanks~Rajesh


#5

Hi @Gitiyboy,

Use if condition to check the datatable is null or not
IsNothing(Eindhoven)

True -.> DataTable is null

Regards, Arivu :slight_smile:


#6

@rajeshprabhu_gp @arivu96

do you mean like picture? What do I put in box if True?