Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setHeaderRow method to readme #567

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

anyk17
Copy link

@anyk17 anyk17 commented Jun 12, 2022

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.

@sskanishk
Copy link

sskanishk commented Jun 27, 2022

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

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

@dgastudio
Copy link

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

@theoephraim
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants