How do I report this error?

Hi all,

I am extremely new to UiPath. I am currently working on a Process in which a company name is an input for a search on a company register website, followed by a click to search and a click to follow the link to the company page. I have managed to succeed so far. My intention is to screen scrape all the details into a data table. However, where there is an instance in which the name is incorrectly input, and the search brings up no results, there is no error reported; the process just ends. How can I set it so that this is recognised as an error, which prompts an error message and returns the user to the start of the process?

Many thanks in advance!

Hi @si_dm2, welcome to Uipath Forum.
Please use “element eixst element activity”. And check that data is available or not.
Give UI selector when there is no data available. It will return bool variable.
Then you can put if condition and inside IF you can print out log message or exception.

1 Like

Hello @si_dm2

Welcome to UiPath community…!

Here in your case if the search is wrong and datatable is not populating, then after Data scrapping , then count of rows in the datatable will be zero.

You can use it as

DT1.Rows.count>1

where DT1 is the datatable. Else you can use the Element exists activity and check for an element. Then use the IF condition.

Thanks

Hi Raja,

Thank you so much for taking time out of your day to help me. I apologise, I am extremely new to Studio and completely self-taught. I’m currently using the latest version of UiPath studio, and when I searched the activity tab for element exist, I only got the options “CV Element Exists” and “Check App State.” Which, if any, of these are correct?

Following this, would I use the IF conditions for the UI Selector when it returns the result of “False” to display an error message that says “Invalid Company Name” or is there a better way to do this?

Thank you again for your time Raja, I very much appreciate your kindness.

Hi Rahul,

Thank you for the welcome and for taking the time to assist me. I apologise for the follow up question, I am a beginner and self taught with UiPath. I am wondering if you know any way in which I might be able to do this prior to data scrapping? I ask because I’m not very confident about data scrapping and feel like its easier to just have the data scrapping trigger upon a valid company name.

Thank you for the time Rahul, I really appreciate it :slight_smile:

@si_dm2
Do you have the list of valid Company names? If yes, you can do this prior to the scrapping.
You can check in the company names and if the search term is valid, then only need to proceed with the next steps of data srapping.

Thanks

Hi @si_dm2

Please check the search result by element exist activity after click on search button . Then use a if condition and scrape the data.

Hello @si_dm2 ,
You can use Element Exist Activity before scrapping the data. You can log error whenever there is no results for particular company.