# Dynamic node settings

**URL:** <https://discourse.nodered.org/t/dynamic-node-settings/57134>\
**Category:** General\
**Created:** [24 January 2022 12:31 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134 "2022-01-24T12:31:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [24 January 2022 12:31 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/1 "2022-01-24T12:31:59Z")

</div>

Hi,

ussually with node README's there is some information about dynamically setting field with a msg.xxx

For below case it could be that the node information will state that the phone# can be set by sending msg.phonenumber to the node. But with this node that is not the case. Can a global/flow variable be use to dynamically set this information?

Sample shown below:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/458427a19bb2620ef5ae9aff632baa52970f191b.png)

---

<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:** [24 January 2022 13:03 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/2 "2022-01-24T13:03:07Z")

</div>

Unless the entry indicates that a `msg.`, `global.`, etc entry is selectable then no, you can't do that.

Where you see something like `${MYVAR}`, that is an operating system Environment Variable.

Use a change node to get a global/flow variable onto the msg and then use msg.xxx if the node indicates that it is supported. In the example given, unless the help info tells you you can override the setting with a msg variable, then you cannot.

Another workaround would be to put the node inside a Group since you can set environment variables in groups. I believe that environment variables are accepted by all inputs.

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [24 January 2022 17:20 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/3 "2022-01-24T17:20:10Z")

</div>

Thanks! I will give it a try tonight

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [18 February 2022 18:58 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/4 "2022-02-18T18:58:14Z")

</div>

do you mean something like this?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/f/3f4f0c63080ca01790b968b046682ccb2b07d5e4.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 February 2022 19:23 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/5 "2022-02-18T19:23:34Z")

</div>

The proper syntax is `${your_env_var}`

Covered in the docs here: [Using environment variables : Node-RED](https://nodered.org/docs/user-guide/environment-variables)

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [20 February 2022 12:18 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/6 "2022-02-20T12:18:36Z")

</div>

Hi Thanks for helping out. However I do have some problems storing and getting back the Environment variable. To test it I made a simple flow which should store and get back to me the environment variable. But it doesn't work.

[edit] i figured out that I have to put the env variables in the settings file. Therefor it won't work for my case (setting the 'from email' from the dashboard)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0f5a1515848d44b9ff330811df873cc32e78bde4.png)

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [20 February 2022 13:43 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/7 "2022-02-20T13:43:54Z")

</div>

I found a work-around using the Powershell node. By formatting a powershell command in nodered and sending executing it, you will have controll of the sender (and its credentials). from the dashboard.

I uploaded the example flow here:  
[https://flows.nodered.org/flow/6eef931189ce2697f7747dc976774367](https://flows.nodered.org/flow/6eef931189ce2697f7747dc976774367)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3001e70f036194a36edb081e78d60fd5b9fd5f0.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0bf59a7a50714f58bdc514be52e9028eb977c7d8.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 March 2022 13:44 UTC](https://discourse.nodered.org/t/dynamic-node-settings/57134/8 "2022-03-06T13:44:41Z")

</div>

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