node-google-spreadsheet
node-google-spreadsheet copied to clipboard
add setHeaderRow method to readme
The setHeaderRow method is not documented in the basics, but it's an important one to be able to work with rows of an existing sheet.
Getting TypeError: h.trim is not a function
while calling sheet.setHeaderRow any reason why ?
await sheet.setHeaderRow({ headerValues: ['name','email'], headerRowIndex: 1 })
same issue with trim
const doc = new GoogleSpreadsheet(id, auth) await doc.loadInfo();
const sheet = doc.sheetsByIndex[0];
await sheet.setHeaderRow({
headerValues: ['name', 'email'],
headerRowIndex: 1
})
o.trim is not a function TypeError: o.trim is not a function at //nestjs/node_modules/google-spreadsheet/dist/index.cjs:1:16426
@sskanishk @dgastudio - I just released a new patch which should hopefully fix this.
Note that you do not need to set the header row unless you are changing those headers. If the cells already have those values in them (which they usually do if you are using an existing sheet) then you can just start pulling data right away.