# Can't write csv file

**URL:** <https://discourse.nodered.org/t/cant-write-csv-file/64369>\
**Category:** General\
**Created:** [25 June 2022 20:14 UTC](https://discourse.nodered.org/t/cant-write-csv-file/64369 "2022-06-25T20:14:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![omardmf](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@omardmf](https://discourse.nodered.org/u/omardmf)\
**Post date:** [25 June 2022 20:14 UTC](https://discourse.nodered.org/t/cant-write-csv-file/64369/1 "2022-06-25T20:14:34Z")

</div>

I'm receiving data from mqtt in the form of a string "Green" i added the nodes csv and write file to log the data into an excel sheet, but nothing is shown in the debug connected to the csv node and the csv file is not created in directory i entered.

 ![Screenshot (636)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e6024e173da343c1cfa9014ce183ebb30ee6834c.png)  
 ![Screenshot (637)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c6d99571d57202caaa1b565634287b4223442d9.png)

the write file node is in the replies

---

<div class="post-metadata">

**Author:** ![omardmf](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@omardmf](https://discourse.nodered.org/u/omardmf)\
**Post date:** [25 June 2022 20:15 UTC](https://discourse.nodered.org/t/cant-write-csv-file/64369/2 "2022-06-25T20:15:13Z")

</div>

write file node.

 ![Screenshot (638)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49bd57c76718805df65ba27cf807bce2376f3605.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 June 2022 22:01 UTC](https://discourse.nodered.org/t/cant-write-csv-file/64369/3 "2022-06-25T22:01:32Z")

</div>

`First off`: name each of your `debug` node so people can look at your debug and know which debug note they come from .  
`Second`: change the `debug` node attached to the output of the `mqtt-in` node to display the complete msg object.  
`Third`: the `csv` node:

> Converts between a CSV formatted string and its JavaScript object representation, in either direction.

`Fourth`: are you sure the mqtt msg coming in a JavaScript object? Where is the mqtt data coming from. You can install the progran MQTT Explorer and watch what is coming thru on the topic you are subscribed to.  
`Fifth`: do you have access to what ever is sending the mqtt data? Can you check to see what it is actually sending.  
`Sixth`: is 'green' being written over and over to the file? (just want to make sure that part is working.

Also what version of Node-RED and node.js are you running (you can get this from the startup log.)

---

<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:** [24 August 2022 22:02 UTC](https://discourse.nodered.org/t/cant-write-csv-file/64369/4 "2022-08-24T22:02:21Z")

</div>

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