How to set Variable in Catch block?

This may seem basic 101, but I can’t seem to figure out how to set a global boolean variable in Catch block?

My logic is>

try {
Do Something
} Catch {
Something failed;
Print e.ToString();
Boolean GoAhead = False; (How do I set this variable?)
}

PS: I have searched for the same and didn’t find anything hence the post.

1 Like

You can use the Assign activity to set the variable to whatever you want it to be. You just need to make sure that the variable exists in the scope of the try/catch.

@RPA4Gov

This xaml could help you buddy
trycatch.xaml (7.1 KB)

You should be clear with this buddy, the variable that you create must have topmost sequence level of scope like this

Cheers

1 Like

Can you refer below link to assign variable in uipath

@RPA4Gov

Is that working buddy,

Cheers

Thanks all. Assign worked like a charm.

1 Like