# Ability to change watched folder

**URL:** <https://discourse.nodered.org/t/ability-to-change-watched-folder/78375>\
**Category:** General\
**Created:** [12 May 2023 07:31 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375 "2023-05-12T07:31:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [12 May 2023 07:31 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375/1 "2023-05-12T07:31:56Z")

</div>

I've written a little flow to monitor my downloads folder and detect if a new file called anything (1).scad appears and rename it to anything.scad

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

But it means I have to hard-code my downloads folder in the watch node

It would nice to be able to use a variable (flow or global var for instance) instead

Any ideas or should I just try and create a fork/PR for the existing node?

As an aside, the node help says I need to \ on windows but it's working fine for me without doing that (on 3.1.0-beta2)

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

---

<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:** [12 May 2023 09:48 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375/2 "2023-05-12T09:48:58Z")

</div>

There is no mechanism that listens for changes to flow or global variables so how would the node know that you had changed anything?  
You can of course use an environment variable set externally that is read at deploy time.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [12 May 2023 09:55 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375/3 "2023-05-12T09:55:11Z")

</div>

I don't need the node to dynamically update - just need to use "d:\users\siwal\downloads" in a few places in the flow so just want to be able to set it at deployment

Which I can except for this particular node

> [@dceejay](#):
>
> You can of course use an environment variable set externally that is read at deploy time.

How would I get the environment variable into that node?

---

<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:** [12 May 2023 10:07 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375/4 "2023-05-12T10:07:55Z")

</div>

Using the. ${my-env-var} syntax

---

<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:** [11 July 2023 10:08 UTC](https://discourse.nodered.org/t/ability-to-change-watched-folder/78375/5 "2023-07-11T10:08:16Z")

</div>

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