added these nodes.
Inject to function
global.set('mynewvar','321');
return msg;
to change node to read value to msg.payload to debug node.
inject into change node to force the global value to the debug sidebar.
That works. The value "321" is shown.
[{"id":"5ee27347.e7ba1c","type":"debug","z":"5ba2fa41.05c4e4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1240,"y":220,"wires":[]},{"id":"b9915530.415c88","type":"inject","z":"5ba2fa41.05c4e4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":840,"y":220,"wires":[["4b9b2ff1.da74c"]]},{"id":"4b9b2ff1.da74c","type":"change","z":"5ba2fa41.05c4e4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"mynewvar","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":220,"wires":[["5ee27347.e7ba1c"]]},{"id":"66de6000.7275a","type":"function","z":"5ba2fa41.05c4e4","name":"","func":"global.set('mynewvar','321');\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":260,"wires":[["4b9b2ff1.da74c"]]},{"id":"436415db.393974","type":"inject","z":"5ba2fa41.05c4e4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":860,"y":260,"wires":[["66de6000.7275a"]]}]
it does not populate the Global Context sidebar... The Flow variables I use do, Globals do not work...