# How to push data to csv and excel?

**URL:** <https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447>\
**Category:** General\
**Tags:** function-node\
**Created:** [10 January 2023 08:20 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447 "2023-01-10T08:20:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [10 January 2023 08:20 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/1 "2023-01-10T08:20:57Z")

</div>

Hi,

May i know how to push the data through the csv file to Excel file or just push data to Excel?

```auto
[{"id":"67e160d143a67534","type":"tab","label":"Flow 11","disabled":false,"info":"","env":[]},{"id":"9d4b3531.391338","type":"inject","z":"67e160d143a67534","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"34","payloadType":"str","x":210,"y":160,"wires":[["f1e704a18d3a8635"]]},{"id":"58da0822.79c4a8","type":"book","z":"67e160d143a67534","name":"","raw":true,"x":370,"y":380,"wires":[["8bd99783.125c38","ed8b8fb2.0d17c"]]},{"id":"ed8b8fb2.0d17c","type":"sheet","z":"67e160d143a67534","name":"","sheetName":"Sheet1","x":540,"y":440,"wires":[["f0303664.0d9938","9c0ed110.bc235","fe9e8ba9.f59db8"]]},{"id":"f0303664.0d9938","type":"cell","z":"67e160d143a67534","name":"","address":"A1","dataType":"w","x":700,"y":500,"wires":[["99f7011e.3ecda"]]},{"id":"9c0ed110.bc235","type":"sheet-to-json","z":"67e160d143a67534","name":"","raw":"false","range":"A1:B2","header":"default","blankrows":false,"x":720,"y":560,"wires":[["4c28547e.6d566c"]]},{"id":"8bd99783.125c38","type":"debug","z":"67e160d143a67534","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.SheetNames","targetType":"msg","statusVal":"","statusType":"auto","x":870,"y":380,"wires":[]},{"id":"99f7011e.3ecda","type":"debug","z":"67e160d143a67534","name":"","active":true,"console":"false","complete":"false","x":920,"y":500,"wires":[]},{"id":"4c28547e.6d566c","type":"debug","z":"67e160d143a67534","name":"","active":true,"console":"false","complete":"false","x":920,"y":560,"wires":[]},{"id":"fe9e8ba9.f59db8","type":"debug","z":"67e160d143a67534","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":440,"wires":[]},{"id":"71fb941ffbdabba9","type":"csv","z":"67e160d143a67534","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"B1","skip":"1","strings":true,"include_empty_strings":true,"include_null_values":"","x":890,"y":140,"wires":[["58da0822.79c4a8"]]},{"id":"f1e704a18d3a8635","type":"file","z":"67e160d143a67534","name":"","filename":"\"C:\\Users\\kelvin\\OneDrive\\test.xlsx\"","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":540,"y":60,"wires":[["71fb941ffbdabba9"]]}]

```

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [10 January 2023 08:31 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/2 "2023-01-10T08:31:51Z")

</div>

Hi @kelvin, could you please tell us which "excel-node" you are using?

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [10 January 2023 08:36 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/3 "2023-01-10T08:36:25Z")

</div>

Hi @rko,

i was using the "node-red-contrib-spreadsheet-in"

---

<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:** [10 January 2023 09:15 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/4 "2023-01-10T09:15:11Z")

</div>

Note: I edited your first post so the flow can be imported.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 January 2023 09:19 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/5 "2023-01-10T09:19:34Z")

</div>

> [@kelvin](#):
>
> node-red-contrib-spreadsheet-in

That is for reading a spreadsheet not writing to it.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 January 2023 09:54 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/6 "2023-01-10T09:54:28Z")

</div>

I gave some suggestions on another recent thread I seem to remember.

The approach depends on a number of factors. One approach would be to avoid trying to output direct to Excel and instead output to CSV (native Node-RED nodes) and use a standard template Excel workbook that uses PowerQuery to ingest the CSV. If additional automation of the Excel side is needed, Node-RED could orchestrate that by calling out to PowerShell and using Office automation.

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [10 January 2023 12:23 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/7 "2023-01-10T12:23:19Z")

</div>

i see ok thanks

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [10 January 2023 14:49 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/8 "2023-01-10T14:49:48Z")

</div>

Hi Zenofmud,

i already edit my post and thanks.

---

<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 March 2023 14:50 UTC](https://discourse.nodered.org/t/how-to-push-data-to-csv-and-excel/73447/9 "2023-03-11T14:50:33Z")

</div>

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