You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constserviceAccountAuth=newJWT({email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,key: process.env.GOOGLE_PRIVATE_KEY,scopes: ['https://www.googleapis.com/auth/spreadsheets'],});constdoc=newGoogleSpreadsheet('<some sheet ID>',serviceAccountAuth);awaitdoc.loadInfo();constdata=getRowData();if(data.length>0){constsheet=doc.sheetsByTitle['some title'];awaitsheet.clear();awaitsheet.setHeaderRow(Object.keys(data[0]));// This replaces the heading row if there are hidden columnsawaitsheet.addRows(data);}
This works fine when there are no hidden columns. However, if I were to hide some columns using Google Sheet's GUI interface, the heading gets replaced by the first row when using sheet.addRows(data)
By hidden columns, I mean this:
The text was updated successfully, but these errors were encountered:
nktnet1
changed the title
[Bug] heading row gets replaced when there are hidden columns
[Bug] addRows replace heading row when there are hidden columns
Oct 5, 2024
Below is the code I'm currently using:
This works fine when there are no hidden columns. However, if I were to hide some columns using Google Sheet's GUI interface, the heading gets replaced by the first row when using
sheet.addRows(data)
By hidden columns, I mean this:
The text was updated successfully, but these errors were encountered: