How to dynamically retrieve arguments passed to an activity

Hi all,

I’m experimenting with Global Exception Handler. Inside this xaml, I have written code for handling System.IO.FileNotFoundException if an excel file is not found in Excel Application Scope. I’m displaying a message box with the message

One of the file is missing. Please put all required file in their location before pressing the OK button.

Is there any possible way for extracting file path of excel file & showing it in same message box ?

Can we extract arguments passed to UiPath’s activities during run time in Global Exception Handler ?

You could pass a Dictionary<string,object> to the global handler and any information you see fit to have in the handler could be appended to the dictionary. Prior to attempting to open the excel file you can simply use the Add To Dictionary activity from the Microsoft.Activities package to add it.

If you need to add another you can just update the value of that key or if you need to track multiple excel files append the dictionary with another entry with a different key name.

Hi @mike.vansickle ,

Thanks for the reply.

Global Exception Hanlder is not a normal xaml. It is called by the run time environment whenever there is an exception. Hence except for 2 default arguments (erroinfo & result), we cannot pass any other argument.

Even if you create an argument in Global Exception Handler, runtime system will simply ignore it.