Xlsx file to json using function

Hii everyone,

I am new to NodeRed. I want to iterate through the Row whose first column is matching with my Input. Shall writing function for these is good choice.

flows.json (1.6 KB)

Screenshot 2024-02-06 170627

Node-red has several contributed nodes for reading Excel/CSV and converting to JSON. Alternatively, you can use a node.js package with a function node which is what I tend to do with more complex needs as in this example where I needed to convert a flat table into a hierarchy:

The function node automatically requires the libraries so that the names in the "import as" column are available as constants in your function node code.

Shall you suggest some example how to use node.js package with a function node in node-red.

I am using node-red-contrib-spreadsheet-in works great - it can read all properties from each sheet, cell etc, including styling formulas etc. There is a specific node to get a json object/array from a sheet.

1 Like

AlaSQL should also work and I think that has a node though not sure if it is still being updated.

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