gglukmann / use-google-sheets

📝 A React Hook for getting data from Google Sheets API v4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Add a new prop that lets us set the row number of the row we want to use for the header

cmarabate opened this issue · comments

Basically I need a way to pull in the data of a spreadsheet that does not use the first row as its header.
For example with...
https://docs.google.com/spreadsheets/d/1nh82R5ROEV1idhYQeujsBNM9mNEatkISdbqQYvR6ZZI/edit?usp=sharing

I want to be able to do something like...

useGoogleSheets({
    apiKey: APIKEY,
    sheetId: GOOGLESHEETID,
    headerRow: 7,
  });

To tell it to use the 7th row as the header instead of the first and ignore everything above it.

Thanks!

Update to version 2.0.0 and look at the migration guide to add headerRowIndex at https://github.com/gglukmann/use-google-sheets#migration-from-v1-to-v2