In exporting an Excel file - how to get the number of columns

how do you get the maximum columns after an Excel file is selected for upload? I can get the maximum rows via this code
$$(“ss”).attachEvent(“onDataParse”, function(data){
let l = data.data.length-1;
let r = data.data[l];
if (Array.isArray(r)) {
maxRows = r[0]; // get total rows, this includes any blank rows if present in the excel file
}
console.log("Maximum rows = "+ maxRows);
});

how to get for maximum columns

Hello @michaelj ,

You can create a function that utilizes the serialize method. This method allows you to analyze the data and determine both the number of rows and columns.
Please check the example: Code Snippet

thank you very much!