# User Defined Evironmental Variables

**URL:** <https://discourse.nodered.org/t/user-defined-evironmental-variables/6455>\
**Category:** General\
**Created:** [6 January 2019 14:40 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455 "2019-01-06T14:40:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ram1505](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ram1505/32/958_2.png) [@ram1505](https://discourse.nodered.org/u/ram1505)\
**Post date:** [6 January 2019 14:40 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/1 "2019-01-06T14:40:45Z")

</div>

Hi,  
I'm referring this [example flow](https://flows.nodered.org/flow/8a13d11dfe80e279df83341e3e17bcc1). I've in one of my flows, a client\_secret as payload. I'm trying to store this payload as an environmental variable. I'm a newbie and I'm not sure how to do it. Can someone help me please?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 January 2019 14:50 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/2 "2019-01-06T14:50:50Z")

</div>

You can not store data in a flow into an environmental variable. You create the Environmental variable in your settings file and store a constant in it. Then in your flw you can access that value.

You can use persistant data and store that - and now that data will remain over reboots or shut down/restarts of NR. See [this in the Documentation](https://nodered.org/docs/user-guide/context) and have a read of this [thread](https://discourse.nodered.org/t/a-guide-to-understanding-persistent-context/4115)

---

<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:** [11 January 2019 23:01 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/3 "2019-01-11T23:01:14Z")

</div>

Just to expand on that, environment variables exist in the host OS. They are only read when starting Node-RED so even if you were to update them, they wouldn't help you.

---

<div class="post-metadata">

**Author:** ![johncaipa](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@johncaipa](https://discourse.nodered.org/u/johncaipa)\
**Post date:** [29 August 2019 06:11 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/4 "2019-08-29T06:11:46Z")

</div>

Hi all, I am trying to use the node node-red-contrib-fcm-push-node and it asks me for a configuration parameter using an environment variable, I have node-RED installed in an AWS instance, but I have not been able to know how to do this, Any help you can give me?  
How do I create the environment variable so I can use it within my flow?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 August 2019 06:35 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/5 "2019-08-29T06:35:23Z")

</div>

An inject plus a change node should do it. But really that is awkward design from the node. I wonder why they did that?

---

<div class="post-metadata">

**Author:** ![johncaipa](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@johncaipa](https://discourse.nodered.org/u/johncaipa)\
**Post date:** [7 September 2019 21:29 UTC](https://discourse.nodered.org/t/user-defined-evironmental-variables/6455/6 "2019-09-07T21:29:47Z")

</div>

yeah, thats the way to use the EV, but how to create it on the server for the node-red instance?
