Nested TryCatch Not Working

Dear all,

I hope you are smiling with joy!

I am doing Practice 1 in Lesson 12 in the Foundation course in which I have to handle the assignment of wrong data types (Example: assigning a string to an integer variable).

The exercise requires checking two variables. The Try-Catch Activity works fine when I check one variable only, but when I add a Try-Catch Activity inside the first one to check the second variable, it detects the error but stops the process instead of moving to the Catch section!

Here is a screenshot for your reference:

Any help would be highly appreciated!

1 Like


Have you set the exception in the inside catch of try catch activity(the second variable checking place)



May i know what type of exception you specified in Catch block ?

Yes. I did add a system.exception for both Try-Catch

I used System.Exception


In the assign activity you can set convert.Toint32(row(“columnname”).tostring) in the value place and i hope even you can pass the double value in the column.
Finally it will move to the catch and followed by the activity.

Thank you for your suggestions.

I tried changing the Assign value, but it did not work. The error prompt, however, has changed.
The new error: "Assign: Input string was not in a correct format."

Here is the data in the table and I just need to fill the “Difference” column with the difference or an error message if one of the two values is not a number.



Can you please share you xaml file and excel file if it is not confidential so that i can look into it.

Sure. Thank you so much.

The material is from UiPath Academy, Foundation Corse, Lesson 12, Practice 1

I couldn’t attach the file directly since I am a new user, so I uploaded it to Google’s Drive:

Thank you again! (25.2 KB)

i have attached the same xaml file with added a message box activity to display the result for difference column.

You just please assign the result variable to the row(“difference”).tostring to write in the excel.

Thank you so much for your efforts.

I tried the recommended actions, but I am still having the same problem. That is, not moving to the “Catch” section after detecting an error.

Your efforts are highly appreciated :rose:

Hello @FirasAbdo

From the screenshot in the first post I see that I has thrown the error, and it has stopped there highlighting it in red. I believe the workflow is correct. Only thing is you are running the program in default Debug mode.

I debug mode, irrespective of whether you have a try catch or not, as soon as you run into an error, it will highlight it in red and stop there. At this instance, on the top ribbon of the Studio, in debug tab, you’ll see continue, step into kind of buttons. Use step in button to continue to the next step, it will get you into to the catch segment by running one step. Debug mode is to test the application. However, if you run in the Run mode (non debug mode) it will not stop there, and it will execute the catch statement automatically…

Try this and let me know whether you still have the problem


I think you are running in debug mode
Kindly run in normal mode and try once, because debug mode won’t let the exception to be caught by catch block and throws error

Cheers @FirasAbdo

1 Like

Thank you so much!!! This actually was the problem. :heart:


Thank you so much sir. It is as you pointed out :heart:

1 Like

No worries :slight_smile:



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.