Unable to Set Reference Flow Variable from Subflow Output

Smashley
Tera Guru

In Washington DC Patch 4 Hotfix 1b I have a Subflow that outputs a sys_user table reference. When I use that output in the "Set Flow Variables" action, it shows as blank (see FlowExecution.png).

FlowExecution.png

 

I have configured the Flow Variable correctly (see FlowVariable.png).

 

FlowVariable.png

Any ideas why this isn't working?

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

It is hard to be sure about how the Flow is actually designed (do include action no. next time into the screenshots), but if the subflow is called inside a loop and the Set Variable flow logic is outside the loop, then most likely that is the problem. You could try moving the Set Variable action inside the loop.

View solution in original post

4 REPLIES 4

-O-
Kilo Patron
Kilo Patron

It is hard to be sure about how the Flow is actually designed (do include action no. next time into the screenshots), but if the subflow is called inside a loop and the Set Variable flow logic is outside the loop, then most likely that is the problem. You could try moving the Set Variable action inside the loop.

Action numbers are not shown in the Flow Execution Context, that is why they are not included in the screen shots.

 

Everything I have seen/read says to NOT set flow variable inside a Do Until loop. But worth a try I guess.

Indeed I'm sure there is a better way to skin that cat; when you are setting a variable in a loop you are basically discarding as many values as there were loops - 1. Only keeping the last. Usually this hints to the fact that that loop shouldn't even exist. But I can't say how it should be optimized in this case, not knowing the whole picture.

I suppose if you could create a Flow Variable within the Main Flow that was an array/list of some kind, after each sub-flow instance execution has completed, you could "push" the sub-flow output value(s) into a unique element on that array (within the loop as mentioned above), thus preserving the exit state of each sub-flow run. This is something I plan to try soon, as I have a need for this.