Use variables from Main in GlobalHandler


I created a Main flow and a Global Handler.
When an error occurs, I want the Global Handler to send a mail with a variable from the Main flow.

For instance, I have three customers x - y - z, the robot loops through them and performs some actions.
Then an error occurs on customer y (y is stored in variable “varCustomer”).
Global handler needs to send a mail with the following text in body: "Error occured for " + varCustomer

Can anyone explain me how I pass the “varCustomer” variable from “Main” to “Global Handler”?

Thanks in advance for the help!

1 Like

I would use a try catch and have the exception activity to use varCustomer in a send mail activity.

Thanks for your reply. That would be a solution indeed, but the application is a bit bigger than in the example. So I want to use a Global Handler, because otherwise I need to implement Try-Catches at multiple places in the code.

@Cedric_Nuyts Sorry about that. I’m not familiar with the Global Handler.

Hi @Cedric_Nuyts,
I want to do something similar. Did you found the solution?


It is not yet possible to use the variables of the main directly in the global handler.

But what I do now, is writing the variables I want to use in the global handler to a file (Notepad or Excel). Everytime the variables change, they get written to the file.
In the Global Handler, the first activity I do then, is reading out that file to get the correct variables.