# Create file with variable name under 0.19.4

**URL:** <https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495>\
**Category:** General\
**Created:** [9 April 2025 09:16 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495 "2025-04-09T09:16:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![F11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/f11/32/73913_2.png) [@F11](https://discourse.nodered.org/u/F11)\
**Post date:** [9 April 2025 09:16 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/1 "2025-04-09T09:16:54Z")

</div>

Hello everyone,

does anyone know how I can assign a file name with a variable in Node-Red version **0.19.4.**  
I want to write a file with a dynamic file name that contains the date.  
The variable works, I can read it with debug and see it among the variables. For example: g\_filename: xyz\_2025-04-09.txt  
If I enter the variable in the file node, the file is created with the variable name 'g\_filename' and not with the generated variable 'xyz\_2025-04-09.txt'.  
In the newer versions this works without problems. Does anyone know the trick in the old version 0.19.4?  
Oh yes .... an update is not an option 😉 true to the motto: never touch a running system!!!

Thanks already  
Roland

---

<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:** [9 April 2025 09:22 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/2 "2025-04-09T09:22:58Z")

</div>

what does the nodes built in help say?

> ### Inputs
> 
> filename `string`  
> if not set in the node configuration, this property sets the filename to read.

i.e. leave it blank, ensure your file name is set in `msg.filename`

---

<div class="post-metadata">

**Author:** ![F11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/f11/32/73913_2.png) [@F11](https://discourse.nodered.org/u/F11)\
**Post date:** [9 April 2025 09:29 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/3 "2025-04-09T09:29:32Z")

</div>

Hello Steve-Mcl

that was easy  
so it works as desired

Thank you very much for the help!!!

Greetings  
Roland

---

<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:** [9 April 2025 09:49 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/4 "2025-04-09T09:49:29Z")

</div>

PS:

> [@F11](#):
>
> 0.19.4?  
> Oh yes .... an update is not an option 😉 true to the motto: never touch a running system!!!

Yeah, if it works, dont change it. 👊

Because [nothing bad could ever happen](https://en.wikipedia.org/wiki/WannaCry_ransomware_attack)`/s`

😉

---

<div class="post-metadata">

**Author:** ![F11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/f11/32/73913_2.png) [@F11](https://discourse.nodered.org/u/F11)\
**Post date:** [9 April 2025 10:57 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/5 "2025-04-09T10:57:34Z")

</div>

the system has no external access,  
I use it to control my heating and a few other things.

But you can never be sure! 🙄 🙈

---

<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:** [23 April 2025 10:58 UTC](https://discourse.nodered.org/t/create-file-with-variable-name-under-0-19-4/96495/6 "2025-04-23T10:58:16Z")

</div>

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