# Set file name from object value

**URL:** <https://discourse.nodered.org/t/set-file-name-from-object-value/88008>\
**Category:** General\
**Created:** [16 May 2024 10:34 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008 "2024-05-16T10:34:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierredemay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pierredemay/32/90948_2.png) [@pierredemay](https://discourse.nodered.org/u/pierredemay)\
**Post date:** [16 May 2024 10:34 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/1 "2024-05-16T10:34:14Z")

</div>

Hello there,

In my case, I would like to use the value "EC\_DATE" of my object to name the outgoing file from my flow.

This is my object :

```auto
{"EC_NUMERO":"BCUSA4","EC_DATE":"15/04/2024","EC_CODE_JOURNAL":"YG","EC_EXERCICE":54,"LI_COMPTE":6522298,"LI_LIBELLE":"Payroll Expenses","LI_DEBIT":3464.75,"LI_CREDIT":"","LI_DEVISE":"USD","LI_PIECE":"","LI_AFFAIRE":"B000030"}

```

Thank you for reading 😉

---

<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:** [16 May 2024 10:38 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/2 "2024-05-16T10:38:08Z")

</div>

> [@pierredemay](#):
>
> This is my object :

Assuming that is in `msg.payload` then simply set the file nodes path field to `msg.` and enter `payload.EC_DATE`

### Taking advantage of the tools provided in the Debug panel:

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![pierredemay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pierredemay/32/90948_2.png) [@pierredemay](https://discourse.nodered.org/u/pierredemay)\
**Post date:** [16 May 2024 10:55 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/3 "2024-05-16T10:55:39Z")

</div>

The only things I understand is this to do this :  
 ![Capture d’écran 2024-05-16 à 12.53.47](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2eefc0017516d23db6977555c24085c196a25bba.png)

But I already try and it doesn't work :  
 ![Capture d’écran 2024-05-16 à 12.53.25](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c679e3f072f45721cc7ffd593f2311ead69ca09.png)

I think I didn't understand what do you wanna tell to me...

---

<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:** [16 May 2024 11:00 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/4 "2024-05-16T11:00:09Z")

</div>

> [@pierredemay](#):
>
> The only things I understand is this to do this :  
> ![Capture d’écran 2024-05-16 à 12.53.47](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2eefc0017516d23db6977555c24085c196a25bba.png)

You are using an old version of node-red. New version looks like this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90b03ded93b3ac9409da3b4a84c17f31a8084f88.png)

Read the built in help for that node - you will see the it permits you to set `msg.filename`

---

<div class="post-metadata">

**Author:** ![pierredemay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pierredemay/32/90948_2.png) [@pierredemay](https://discourse.nodered.org/u/pierredemay)\
**Post date:** [16 May 2024 14:15 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/5 "2024-05-16T14:15:41Z")

</div>

I think I don't see that cause I use a "corporate version" of Node-RED proposed by my company cause, when I launch Node-RED on my personal computer (v3.1.9) I see that part of the node.

---

<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:** [16 May 2024 14:40 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/6 "2024-05-16T14:40:37Z")

</div>

> [@pierredemay](#):
>
> "corporate version" of Node-RED proposed by my company

Judging by your other thread, your company version is waaaaay out of date & probably using old End Of Life versions of NodeJS (and I suspect along with all its unfixed critical CVEs waiting to bite 🤷‍♂️).

Node-RED V2.X and V3.X offer lots and LOTS of benefits in features and fixes, you might want to nudge the powers that be in your company to catch up?

Or perhaps switch to [FlowFuse](https://flowfuse.com) if they need a professional means of running Node-RED? (shameless plug - I work for FlowFuse)

---

<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:** [30 May 2024 14:41 UTC](https://discourse.nodered.org/t/set-file-name-from-object-value/88008/7 "2024-05-30T14:41:31Z")

</div>

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