i am struggling with some logic, i have written one logic that if that occurs bot should throw the exception and go to end state and send the email, but if that doesn’t occur it should simply logut from the application.
But just trying to check that if condition and stops there, which is wrong.
I think that you can create another variable to work as “flag”, if any excepcion appear you can save the message if that variable. Then in your if activity don’t validate the message, just validate if the variable contains some text, if so, it means that an exception was thrown, if not, it means no exception appeared. Use the below code to validate if your variable contains any value or not
Try Catch
Try
-- Your main workflow here
Catch SystemException
If (exception.Message.contains("No Data Available at this time in Markview"))
Send Email
Else
-- Log out from the application
in the above image, i am trying to check the text in application and if it matches, then it will throw with same messgae and this written in initallapplication state and it goes to end state which it is checking in if condition (img already shared in above chat) that same message is coming or not, then if it is there it should send an email, but there no exception occured while running the Bot and still it is trying to check the if condition.
Suggest me the solution in detail way, how should i write the logic please.
ok, i changed to system.exception. but here i am not writting in try catch.
what i am doing is , if this exception occurs, bot is going to end state where it is checking for the exception in if condition, so what should i do, should i use try catch here
No need to go into the End State.If system exception occurs it will go in the transition of system Exception.So,Go into the System exception trans and give the if condition and send email.