Click Activity for Ui selector not found error handling

Hi UiPath community

I have a click activity on the UI below:
image

My activity would need to click it, to display a data table which then I will extract using “Extract Data Table” activity.

The problem is sometimes that UI is not available, and my click will prompt error and bot will stop.
How do I handle such UI error?
I wanna be able to continue to the next activity, but I want to input a variable = “Data not found” in my output result.

I found out I can use Try catch, how do I use the activity correctly to handle this, I tried before but it is not working as intended it on my other automation.

Thank you in advance!

Hi @Irfan_Musa

You can use the Check app state activity and indicate on the Ui element. In the Target Appear block insert the click activity and indicate the Ui element.

If the Particular Ui element appears then only it will click on Ui element.

Hope it helps!!

@mkankatala if it does not appear I want to output it as “Data is not found” and how do I do that? Do I need to assign variable?

Exactly… @Irfan_Musa

In the Check app state activity there is one more block called Element does not appear, in that block insert the Assign activity to initialize the variable with “Data is not found”

Check the below image which helps you for understanding,

Hope you understand!!

@Irfan_Musa

In click properties please give the delays .Delay after and delay before

Use retry scope activity if the bot fails to click then it will retry .

In the check app state activity indicate the element that appears after clicking.So the bot retries until that element appears

Hi @Irfan_Musa

Use Element exists activity.
Store output in a boolean variable.
If boolean var = true
then click
Else
Data not found