Hey,
I am trying to give our users the possibility to upload an XLSX file (through ng-file-uploader), and to convert this XLSX file to JSON data afterwards.
The uploading of the file works fine, this is the result when I print $scope.file in the console:

When I try to use the sheet to json function, I get an empty array back, while there is a lot of data in the uploaded XLSX file.
In my code I use the following:
XLSX.utils.sheet_to_json($scope.file);
This returns an empty array as said before.
Is there something I'm forgetting or should execute differently?
Kind regards,
Thomas
Update: I got the file into the XLSX tool now. I was able to create the workbook, but now I'm trying to use the XLSX.utils.sheet_to_json on one of the sheets inside the workbook in the following way, and I'm getting an error:
var roa = XLSX.utils.json_to_sheet(workbook.Sheets['1 LG woorden']);
The error:

This is my workbook object:

how did you solve this ? am having the same issue on nodejs
@Xsmael I solved this setting a the name of the sheet you want to use and also the header, which might help you to identify each column.
var workbook = XLSX.read(bstr, {type:'binary'});
var form = XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[3]], {header:["headerName1","headerName2","headerName3"]});
Where workbook.SheetNames[3] is the name of my third sheet, which is the one I'm using in this example.
I hope this helps you
Most helpful comment
@Xsmael I solved this setting a the name of the sheet you want to use and also the header, which might help you to identify each column.
Where
workbook.SheetNames[3]is the name of my third sheet, which is the one I'm using in this example.I hope this helps you