node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

add setHeaderRow method to readme

Open anyk17 opened this issue 2 years ago • 3 comments

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.

anyk17 avatar Jun 12 '22 19:06 anyk17

Getting TypeError: h.trim is not a function while calling sheet.setHeaderRow any reason why ?

await sheet.setHeaderRow({ headerValues: ['name','email'], headerRowIndex: 1 })

sskanishk avatar Jun 27 '22 07:06 sskanishk

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

dgastudio avatar Sep 07 '23 19:09 dgastudio

@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.

theoephraim avatar Sep 07 '23 20:09 theoephraim