# Global and Flow variables inside filename

**URL:** <https://discourse.nodered.org/t/global-and-flow-variables-inside-filename/60970>\
**Category:** General\
**Created:** [8 April 2022 09:52 UTC](https://discourse.nodered.org/t/global-and-flow-variables-inside-filename/60970 "2022-04-08T09:52:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giu-seppe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/giu-seppe/32/40489_2.png) [@Giu-seppe](https://discourse.nodered.org/u/Giu-seppe)\
**Post date:** [8 April 2022 09:52 UTC](https://discourse.nodered.org/t/global-and-flow-variables-inside-filename/60970/1 "2022-04-08T09:52:19Z")

</div>

Hi all,  
is there a way to insert a global or flow variable concatenated to a string in this field?  
the watch node does not have an input from which to send the filename

The screenshot is perhaps more explicative

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 April 2022 10:15 UTC](https://discourse.nodered.org/t/global-and-flow-variables-inside-filename/60970/2 "2022-04-08T10:15:32Z")

</div>

No. The watch node is initialised to monitor the file(s) at instantiation and therefore uses a fixed value. for example, if this were possible, it would not know that a global has changed & would not know to start watching another directory.

You have 2 relatively simple options...

1. Use an ENV VAR e.g. `${WATCH_FOLDER}`
2. DIY this using a function node and import a watch lib from NPM.

---

<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:** [7 June 2022 10:16 UTC](https://discourse.nodered.org/t/global-and-flow-variables-inside-filename/60970/3 "2022-06-07T10:16:31Z")

</div>

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