# How to set env variable

**URL:** <https://discourse.nodered.org/t/how-to-set-env-variable/18612>\
**Category:** General\
**Created:** [29 November 2019 14:33 UTC](https://discourse.nodered.org/t/how-to-set-env-variable/18612 "2019-11-29T14:33:28Z")\
**Posts on this page:** 1\
**Showing post:** 15

<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:** [1 December 2019 08:13 UTC](https://discourse.nodered.org/t/how-to-set-env-variable/18612/15 "2019-12-01T08:13:15Z")

</div>

@DemonKing environment variables are only evaluated when flows are started. The runtime gets their values before passing them to individual nodes. The nodes don't know the value came from an env var.

If you change an env var it does not magically cause the node to change its configuration. You'd need to restart Node-RED to pickup the changes.

I understand you have a requirement to dynamically change the mssql connection details. Unless there is a node that already provides that ability, then you are short of options other than creating a custom node of your own.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-set-env-variable/18612)._
