If I have a spreadsheet and I load it via the Read Binary File node, is there a way to extract a list of the sheets from the spreadsheet, so that I can loop over them?
Similar question for the Google Spreadsheet node.
If I have a spreadsheet and I load it via the Read Binary File node, is there a way to extract a list of the sheets from the spreadsheet, so that I can loop over them?
Similar question for the Google Spreadsheet node.
It seems I can allow external modules and get them via:
const { read: xlsxRead } = require('xlsx');
const data = items[0].binary.data;
workbook = xlsxRead(data.data);
return workbook.SheetNames.map((s) => {
return {
json: {
name: s,
}
}
});
ahh, really good idea. Thanks for sharing the solution.
It did solve my issue, though I think I will add a feature request so that a single Spreadsheet Node can output multiple sheets, because adding the loop was also a bit of a pain.