Flow and Global const - Feature Request

Hi Everyone,
I realise that I can declare node scoped const types.
may I request that a feature is added that would allow flow, and or global scoped const.

It could be by way of the side bar under storage where they could be created and modified under the relevant section.

Or allow a comment node to be referenced in the setup or function tab of a function node in a way which is similar to include.

Many thanks to all who maintain Node-Red for getting us to where we are!

Cheers.
Paul.

Hi @FatPilot

I'm not sure what you mean by flow, and or global scoped const that is different to how you can set flow or global context values already.

I'm sure we had this discussion recently.

For example, create a flow that starts with an Inject node configured to trigger on start. Wire that to a Function or Change node that sets whatever flow/global values you want.

That then means the creation and management of those values is an integral part of your flows and can be exported/imported alongside the flows that make use of those values.

Hi @knolleary
Thanks for getting back to me.
I am not a professional programmer so please excuse some of my terminology.
I come from the Z80 hand balling assembler on the Sinclair ZX80 and spectrum days, and later to developing apps using MS Visual FoxPro. So I am not new to programming Just getting old!.

Yes I can see what you are saying about using context variables and that certainly is a solution to the problem. The other part of the issue is being able to include code from another source e.g a comment node, which would in the solution you have offered reduce perhaps many get.flow statements at the begining of the function node code.

I am only making a suggestion and not being in any way critical. I really love Node-Red and have buried myself in trying to learn as much as possible about it.

Many Thanks.
Paul.

1 Like