Exception handling if product is not found

Hello, I am new to RPA express and currently trying a simple project to search stock price and copy it to excel.
Somehow it is not working and if a stock price is not found, how can i log it in the same excel file?

@Kinalina To use Exception Handling, you need to insert the actions that might throw an exception in the Try to complete part of the action. See the training video for more details: https://kb.workfusion.com/display/RPAe/Training+Videos#TrainingVideos-ErrorHandlingAction

But I think this script is not going to work, as you take the stock price right from google, and it is not going to show it unless you are logged in.
Try using another website, for example, https://finance.yahoo.com/, to search for stock prices.

Karen, did you have a chance to check out the training video? Did it help?

Thanks, i tried it with https://finance.yahoo.com and it works…however still trying how to enter the error into excel.any idea?

Hi @Kinalina

The flow could look like this
Exception handling
Try to complete
Get value of error message on page (for example “no results for search term xyz”) and save into “search result” variable
On error
Get value of stock price and save into search result variable
Open excel
Set cell abc to search result variable

1 Like

Thanks, i tried and it works.
However, when I tried “if an exception occurred”-set value to $888.00 but it didnt work…it works without the $.Capture
why is this so.

Try putting the $ into “$” or /$/

Hi, i tried and it doesn’t work too.so i tried to to use the replace action to add the $ after the constant value but error occurred. It seem to be able to take other value such as ** or “” but not $.

Are you using Constant value action? Then it will fail if you try to insert a dollar sign. We’ll fix it.

Before that, you can use such workaround: put the dollar sign in a variable, and then use this variable when setting value.

Thanks! it work perfectly!

1 Like