Excel xlsx export library

Hi, i am looking for a library to export things to an xlsx file. I already tried some libraries, but at all of them you can´t skip cells. For example after Inject1 i want "test1" in cell1. After this, the flow forgets the information which is in cell1, but i know that i need to write the next value after inject2 in cell2 afterwards.

All libraries i tried, the flow needed to save the informations from every cell, i couldn´t skip existing cells.

Does anyone know a xlsx library, where i can tell information xy goes to cell x? Otherwise i would need to write everything in a database first and then export the whole database to xlsx. But i want to cyclic add information in an existing xlsx file.

Thanks, Stephan

1 Like

You cannot do this the way you describe. Saving an Excel file, by definition, saves whatever is in the file at time of save.

You have a couple of choices. Either manage the data in a JavaScript object (e.g. an array of objects where each inner object is a set of column-name/value pairs which is directly mappable to an Excel sheet) and make sure that object contains the right data and time of save to file.

Or, use a library that allows direct manipulation of Excel cells.

I think you misunderstood me. Saving is not the problem. I could save after each array of information. But the xlsx libraries i found fill the cells from begin.

I‘d need a library where i can fill specific cells, for example a12 to f12, then save and close and after next inject fill array in a13 to f13, save, close. Next inject: open file, fill array in a14 to f14, save, close and so on.

1 Like

This looks like it might do what you want. I've not tried it though.

I think this might work as well:

There are hundreds of other node.js libraries on npmjs most of which should work with Node-RED with a bit of work.

1 Like

I also need save data with xlsx file.can U tell me which node you use to save data with xlsx formate.

@TotallyInformation thanks, this is exactly what i was looking for!

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