Out Arguments not passing to variables when encountering a throw exception

I am trying to pass a variable back when an exception occurs (to write back to excel), but when I encounter the exception my variables are set to Null…
Ref link: Out arguments not carrying value upon exception

Seems like its a bug thats still not been fixed for over a year…

1 Like

Hello @JFletch100 ,

It would be better if you can share the screenshot of the workflow.

Also you are trying to pass the output from invoked worklfow to the main. Please make sure in the invoked workflow the OUT argument is holding some value.

You can use a try catch and if an exception occures it will go to catch section. Then there change the value of argument.

Try to use write line to print the value of the argument or run in debug and check the value of argument.

I am not sure it is a bug.
You can use reference type variables like list, datarow, array, etc. Otherwise your variables like integer and string will be set as null when you get exception but reference type variables will keep their value.

hi - trying to pass variables from invoked workflow to the workflow above - not the main workflow in this case. I can try setting the out variable at the workflow to have a blank value

Ok…Could you share some screenshots?
Also in the Invoke workflow activity, did you imported the values?

Hi @JFletch100,
I have encountered the same problem, have you found a solution?