Sending data from node-red to xlsx file on windows 10

Hello, I'm still very new to Node-red and am confused on how to create a xlsx file and update it through the flow

Basically, I tried to recreate a flow from this reference

I modify the input to just a timestamp with a moment node(node-red-contrib-moment) and connect it to csv then to the file node. This is my flow:

When I deployed the flow and clicked the time stamp, there is a payload but no xlsx file was created/updated (when I manually create the file).

FYI, I use siemens IoT 2050 to connect to node-red and on windows 10 (idk if there is a difference)

I believe there might be an issue with permissions to the C-drive folder you specified, or maybe the format. Can you try a few variations, for example..

c:/file.csv or c:\\file.csv

(try a .csv first...once that works, change to .xlsx)

Just a crazy suggestion...rather than sending to Excel (once an hour, once a day, etc.), why not send to a free InfluxDB database and view it via free Grafana? I started using Node-RED for a similar task (temperature readings) and this video helped me get started with the NR+Influx+Grafana trio.

1 Like

Hi, thanks for the reply!
I tried to change the path format, the file extension, and change the path from C to my D-drive. But all that doesn't seem to work.

Thanks for the suggestion, but on this project one of the objectives that are given to me is to create a .csv or .xlsx file from the node-red. Do you mind trying my flow and see whether there is a problem? this is my flow as of now.

[{"id":"ee64ddc4.82773","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"f4ed7228.1727","type":"inject","z":"ee64ddc4.82773","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["d3c27fc0.e81ec"]]},{"id":"d3c27fc0.e81ec","type":"moment","z":"ee64ddc4.82773","name":"","topic":"","input":"","inputType":"msg","inTz":"Asia/Jakarta","adjAmount":"0","adjType":"hours","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"en_gb","output":"","outputType":"msg","outTz":"Asia/Jakarta","x":360,"y":140,"wires":[["3839708f.ea64a","a44f5.508d8b0b8"]]},{"id":"3839708f.ea64a","type":"debug","z":"ee64ddc4.82773","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":240,"wires":[]},{"id":"c1158bc0.daaa38","type":"file","z":"ee64ddc4.82773","name":"TestNodered","filename":"\\Users\\Aldryan Minanto\\Documents\\TestNodered.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"utf8","x":830,"y":140,"wires":[["c7cbf44b.daef48"]]},{"id":"c7cbf44b.daef48","type":"debug","z":"ee64ddc4.82773","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":240,"wires":[]},{"id":"a44f5.508d8b0b8","type":"csv","z":"ee64ddc4.82773","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\r\\n","temp":"Time","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":630,"y":140,"wires":[["c1158bc0.daaa38","a1f60d30.79f07"]]},{"id":"a1f60d30.79f07","type":"debug","z":"ee64ddc4.82773","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":240,"wires":[]}]

Or maybe if you have a similar flow, do you mind sharing it? thank you again for the help!

@Aldryan Thanks for the flow. I got it to work with the following (on my PC)...

Filename (in Write File node): F:\Users\USER\Documents\NodeRedTestFolder\NodeRed.csv
(adapt to a folder of your choice on your Windows PC)

I also had to change the permissions to the folder (to "Full control"):

Hi, I'm glad that my flow is working fine, I've tried to change the file path and the permissions of the folder, but it's still not working. Are there any other external factors that I need to change?

Do you have any errors appearing in the Debug pane?

Not that I could see, I hope this gif could explain my current situation.

Part 1

Uploading: Part 2.gif...

Part 2 of the gif
Part 2

As you do not have any errors in your debug pane, I believe your flow in Node-RED is fine. Your problem must be related to your Windows permissions. Keep trying different combinations, folder locations, (even a USB drive), etc.

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