# Advise in using globals, flow vars en msg content

**URL:** <https://discourse.nodered.org/t/advise-in-using-globals-flow-vars-en-msg-content/20564>\
**Category:** General\
**Created:** [19 January 2020 09:28 UTC](https://discourse.nodered.org/t/advise-in-using-globals-flow-vars-en-msg-content/20564 "2020-01-19T09:28:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvanklink](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pvanklink](https://discourse.nodered.org/u/pvanklink)\
**Post date:** [19 January 2020 09:28 UTC](https://discourse.nodered.org/t/advise-in-using-globals-flow-vars-en-msg-content/20564/1 "2020-01-19T09:28:54Z")

</div>

Hi, my management console is finished, and runs flawlessly and stably with node-red, mqtt, and various domoticz servers with rpis in the wan.

I have some questions about the proper use of variables and to learn how to program properly ...

My current situation is that:

- I mainly use flow variables in the menu (list nodes) because after filling different list nodes the messages are lost;
- in the menu when starting an option (button start); the flow variables are converted into msg variables that are then used in the execution of various submodules ...
- I have set ip addresses and passwords as global variables (url1-10); name and password are in the global urls

My questions:

1. Is storing names and password in globals secure?, among other things, when sharing flows via an export?
2. Is it correct that I convert the menu items at execute (start button) to message variables or should I have used the flow variables in executing the flow with different sub-modules?
3. The dashboard displays standard information, status information, history, etc. Is it wise to fill these information items with their own messages, or with one message with different fields ?

De main architecture of my management console:

 ![arch](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5cb67e78e62059a97c66ca3e4e8aa11442c18e2b.jpeg)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 January 2020 10:55 UTC](https://discourse.nodered.org/t/advise-in-using-globals-flow-vars-en-msg-content/20564/2 "2020-01-19T10:55:36Z")

</div>

> [@pvanklink](#):
>
> Is storing names and password in globals secure?, among other things, when sharing flows via an export?

Not really. The globals are in-memory by default so while reasonably well limited to Node-RED itself, they can be read by specialist hacking tools.

However, when sharing, the variable will not be included in the flow unless you have a node that sets it to an explicit value.

> [@pvanklink](#):
>
> Is it correct that I convert the menu items at execute (start button) to message variables or should I have used the flow variables in executing the flow with different sub-modules?

Hard to say, not sure there really is a right and wrong approach.

> [@pvanklink](#):
>
> The dashboard displays standard information, status information, history, etc. Is it wise to fill these information items with their own messages, or with one message with different fields ?

Again, not sure there is really an absolute here. Probably depends on the update cycles for different parts. If they all update on a similar frequency then you might as well do it together, if they all update independently, then separate messages may be best.

---

<div class="post-metadata">

**Author:** ![pvanklink](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pvanklink](https://discourse.nodered.org/u/pvanklink)\
**Post date:** [20 January 2020 13:35 UTC](https://discourse.nodered.org/t/advise-in-using-globals-flow-vars-en-msg-content/20564/3 "2020-01-20T13:35:56Z")

</div>

thanks for the responce
