"In my UiPath process, I’m encountering an issue where all variables become Null whenever a system exception arises. This is causing problems because I need these variables to stay populated to send a ‘max retry’ notification email after reaching the retry limit. However, due to the variables becoming Null, I can’t access their values in the send mail activity.
How can I ensure that my variables retain their values even after a system exception, so I can successfully send the notification email with the necessary details? Any strategies or best practices for handling variable persistence in this context would be greatly appreciated!"
if using Reframework, you can have variables at main level ( in our custom ref we got retryNumber at main level and when we set the transaction status we increment in case of Fail for SE, then we compare with max retry allowed in queue for instance ), and you can put it in argument in/out in workflows.
Other possibilities is to use global variables, you will be able to use them anywhere in your project and data will not be lossed.
Best option would be using Global Variables here. It will preserve the value whatever you assigned to it throughout the code execution and available in all the workflows.