DEV Community

Discussion on: How to send data to a Google spreadsheet, in 2 seconds?

Collapse
 
chrisachard profile image
Chris Achard

Oh, neat! I have always thought google sheets could be used as a kind of database, but thought it would be a lot harder to integrate with... thanks! I'll definitely try this out.

oh - is getting data out of the spreadsheet just as easy? (I guess once you have the token, then yes?)

Collapse
 
frenchcooc profile image
Corentin

Hi Chris! Thanks a lot. Really appreciate ;)

Getting values is just as easy. Replace step 4 with the following and you will be ready to go:

gsheet
  .auth('YOUR_BEARER_AUTH_ID')
  .get(`${spreadsheetId}/values/A:Z`)
  .then(({ data }) => {
    console.log(data)
  })
Collapse
 
corporatedrone profile image
CorporateDrone • Edited

Hello Corentin. I've been looking for something like this for a long time. For fetching the data, your example uses 'gsheet'. Is this another library? I can't quite figure out what to do with it.

I also tried modifying the fetch example using get, but got a CORS error.

Collapse
 
chrisachard profile image
Chris Achard

Awesome - going to play with that this weekend :)