Global/Flow Variable Access in Custom Node?

I was using globalContext.get("myVariable") in my custom node in order to read my application global variable, but that syntax is not working.

What is the correct syntax to access my Global variable within my node.js file?

Thanks...

global.get("myvar")

That does not work from inside the node.

https://nodered.org/docs/creating-nodes/context

Yeah, I was a bit confused, but added to the node.js file ```
var globalContext = this.context().global;

then, globalContext.get("myVal")

:grinning:
1 Like