I am trying to use a switch in my UI and update the value of the switch (true or false) in a function node in another part of my flow. Based on the switch output, I am trying to use flow.get in the function node to set a variable. However, when I try to use flow.get, it just sets the variable in the function node to "null".
Below is my flow with the switch, and the code in the connected function node:
var btnOpOverride = msg.payload;
msg.payload = btnOpOverride;
The code in the other function node in the flow looks like the following, but when I run this I get the default value for the first go around for the OperatorOverride variable, and then a "null" value the 2nd time around:
OperatorOverride = flow.get("btnOpOverride");
What am I doing wrong? I also tried some other things but nothing seems to work. I also tried doing flow.get and flow.set from the function node close to the switch, but that did not work either.
Thanks in advance for your help!