Access variables in flow without connecting it (function)

Hey guys!

In my function i want to have access to other variables. I want to send a string to my function without connecting it. In the inject node is a string "Axel" and I send this to a change node en change the msg. to flow.name. How do I access this variable in the Function?

Thank you and kind regards,
AxelD

afbeelding

afbeelding

afbeelding

afbeelding

At the moment your change node is setting msg.payload to the value of flow.name. If you meant to set flow.name to the value of msg.payload you need to swap around those to fields in the Change node.

Then I get this message in the debug.

afbeelding

Is that not what you want?

No not realy, but I just found the answer I was looking for.
Thanks anyway!

afbeelding

afbeelding

The Function node that does global.set("test24", msg.payload) could be a Change node configured to set global.test24 to the value of msg.payload.

The second Function node could be a Change node configured to set msg.payload to the value of global.test24.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.