Dynamic node settings

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

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.

Thanks! I will give it a try tonight

do you mean something like this?

image

The proper syntax is ${your_env_var}

Covered in the docs here: Using environment variables : Node-RED

1 Like

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)

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

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