Control Google Sheets with Node.js / JavaScript (v4 API)
Вставка
- Опубліковано 8 лип 2024
- In this tutorial, we use the Google Sheets API v4 with Node.js & Express to completely control Google Sheets (read & write) and at the end create a demo video request application! This API can help you create anything from a totally custom "Google Forms" replica, all the way to using Google Sheets as your database solution! I hope you enjoy and find this tutorial useful!
----------------------------------------------------------
👀 Tutorial Links:
----------------------------------------------------------
GitHub Repository: github.com/jrgrimshaw/google-...
Google API Console: console.cloud.google.com
----------------------------------------------------------
💻 Commands Used:
----------------------------------------------------------
npm init
npm install express ejs googleapis
npm install -D nodemon
nodemon index.js
----------------------------------------------------------
⏰ Timestamps:
----------------------------------------------------------
0:00 Introduction
0:30 Get Google API Credentials
4:39 Setup Node.js/Express Application
8:28 Use the Google Sheets API!
20:19 Optional Extra: Create a Video Requester Demo Application!
25:39 Outro
----------------------------------------------------------
📚 Resources
----------------------------------------------------------
Editor (Visual Studio Code): code.visualstudio.com/ Theme: Synthwave '84
Web Browser (Back on Chrome!): www.google.com/intl/en_uk/chr...
Terminal (iTerm, Mac only): iterm2.com/
MDN (where I reference JavaScript documentation): developer.mozilla.org/en-US/d...
----------------------------------------------------------
🔗 My Links
----------------------------------------------------------
GitHub: github.com/jrgrimshaw/
Instagram: / jrgrimshaw
LinkedIn: / jrgrimshaw
Personal site: jgrimshaw.com
#jamesgrimshaw #nodejs #googlesheets
Thanks for sharing. I was thinking about doing this for my mailing list, where spinning up a PostgreSQL database just for this seemed overkill. I didn't expect it to be this involved, so I'm really glad you put this together.
Thank you for making this. My website was using v3 and it just got deprecated this month and I was totally lost with how to read a google sheet with the v4 api. This was a life saver. Thank you!
Oh thank you, man 🙏
I've been trying to do a similar thing for three days, almost gave up and tried googling for such a video, and there you, thanks again 💪
Thank you, you are a savior. I was given a test related to google sheet connector for my first dev role interview process and successfully completed because of you. Thanks a lot for creating this.
Building something at the moment where I need to read from a Google Sheet... I'm back here reminding myself how to do it 😂
Hi James, if i update a cell, will it show in edit history of the individual cell? I'm looking for a way to edit a cell without it showing in the edit history.
🤣
THANK YOU ... FINALLY, SOMEONE SPEAKING CLEAR ENGLISH HAS MADE A TUTORIAL ON THIS TOPIC THAT TRULY HELPS ... THANK YOU !!
Thank you for such a great, crisp tutorial. This should be the goto place instead of the docs.
bruh... literally what I was looking for. Thank you for making this complicated subject easy to understand.
Thanks a lot man, you saved me here, I was requested to do a simple database using sheets API but the google documentation is awful,your explanation is very good, congrats!
Appreciate you watching! :)
I have been looking for a tutorial on how to do this for a couple months. This is the best-explained one I have come across. Thank you! I have now subscribed :)
Wow thanks so much! More videos coming soon :)
I tried some tutorial on the internet and fail. Then I find yours :). Thank you so much!
Clean, Clear, and Concise. Bravo!
Thanks for this! I was bouncing around reading the docs for way too long!
You made this and the website it is about and haven't made a video since 😞...... you are a good teacher...
Thanks for the great explanation, quick note:
you don't need to use auth in the options every time you are using googleSheets, because you already pass it in the start (when you set google sheet version and auth)
Great point :)
Thank you so much for this tutorial.
it's perfect for me because I'm working with express and google sheets API.
Great tutorial, thanks !
Worth mentioning : googleapis ONLY works on the server side. This will not work in a client side application like React or Vue alone.
This is great, James, it served me perfectly. Thank you.
You are awesome. This was just what I was looking for!
Good video, I was reading the Google Sheet API and I don't undertand but I can
This is a very very beautiful tutorial! Very detailed… 🙏🏽
This was exactly what I needed Lol Thank you so much!! Great video!!
So glad you found it useful! :)
u save my day!! that a really wonderful tutorial
Beautifully Explained!! Thanks
great video and content. love the teaching style keep the good work up man.
best explanation I've ever seen
Awesome video! Sad to see that you stopped making more videos.
Thanks for this great tutorial, James.
THANK YOU VEEEERRRRYYY MUCH. you are the best. i am so glad i found this vid
This video is exactly what I needed, thaks )
Great explanation, pretty much got all i need to know. Thanks :)
Thank you, the tutorial is nicely done. :D
Thanks Sir, Really helpful and the way explained is awsome.
Thank you! Very helpful and informative.
Thanks a lot!
This seems like exactly what I've been trying to make.
Just trying to figure out how to make it work on a website next.
I guess at least I have to secure the credentials file somehow...
Great tutorial on working with Google sheet api , that is get starter for everyone. Thnx
This actually saved me. Thanks bor.
Thanks! Awesome explanation!
Wow, thanks for the tutorial!
Neat idea! Imma take some notes 📖
So cool isn’t it!!
Best video. Working very well for me
Great video, thanks for making this so simp😀le compared to most other videos available on UA-cam 👍
Thanks brother, this was useful for me.
thnks a lot, this video is really helpful.
That’s a great tutorial regarding Google Sheets API. Your explanation is decent and very detailed. Could you make a video how to sync Google sheets with Next.js?
Perfect, you saved me. THANK YOU
Very good tutorial! Thank you.
Hey man! Insane tutorial thanks you ! Same a lot of time
Just found out the channel, thank you keep it brother great content and flow cheers
thank you. there should be a free no-code app to recreate this particular scenario. Custo form submitted to google sheets and read from google sheets a render as HTML.. this would cover 90% of every small business needs.
Quite a handful of instructions. I think is a lot easier to just create a google app script to handle the CRUD operations on google sheets. That way you only need the deployment url in your nodejs to initiate reads and writes.
Thanks though, it was very informative!
thank you so much. it's very helpful
Thank You! Great job!
Thanks a lot! Great video
Very helpful, thank you.
Great tutorial!
gj creating a video on this. you saved me some time. ty sir
Appreciate you watching! :)
Simple to the point...
Do you have any tutorial on google fit api?...
Thank you so much, idol!!
Thank you. Wish you would have explained Express
good job male, thanks!
great video.thanks!!
this was so useful thanks
Dotenv module will be helpful to hide credentials details.
Very Helpful... Thanks for sharing
how to do that?
Thanks for the tutorial, James. There isn't a lot of solid tutorial content surrounding the Sheets API and Node.js but yours is spot on. Do you have the link to your blog in which you take a deeper dive into working with Google Sheets API? Also - ever think about teaching a Udemy course on the subject?
I never got around to writing a blog post on this! I want to make more videos and maybe courses in the future though
Thank you for this video
One tip for you, since you share tips with us :-) npm init -y will initialize project folder with default values for you
Great tip!
Amazing. Thanks. 👏👏
Very good video clear and sharp! A little question though , any idea how to delete a row with the API ? Thanks in advance.
Thank you so much bro
please make something about passport js ur explanation is really top notch
The next series will be an authentication series!
epic tutorials bro
definitely a good video, thanks for sharing
Really appreciate you watching! :-)
great video, thanks
Thanks buddy!
Bro I am Missing your videos, I subscribed you with hope
Great video!
Thank you! :-)
thank you very much !!!
helpful.. thanks
Thank you for this great content. Unfortunately I'm experiencing difficulties implementing this. I have a basic form set up with react and nodemailer which works fine but sending the data to Google sheets returned an error: invalid credentials. Pls how do I fix this
Great Video!
Appreciate you watching :)
fantastic !
Another question about namedrange, they are listed in your Metadata variable but how to create a new one from the API ?
Thank you !!
I think Integromat does it easier, good tutorial btw thanks.
Thanks!
Thank you sir
Hey James, you always try to provide something useful. it's an awesome video. since I am using an API tool of Sheet Best which is easy and secure for me, I can't apply something new.
Thanks guy
This is so great. Thank you.
As long as I know adding Reactjs to this should not be a big deal isn't it?
Convert the node.js app to an API, and then use fetch calls to integrate with a React.js app. Should be straightforward :)
Nice Video! Please tell me, how i can read the values in sheets and use with aplications to for example show in div?
Hello, how can you make a FOR loop with 2 columns, for example phone number and message to send?
Muchas gracias
Is there any way to read from a spreadsheet and use the data on the spreadsheet to input information on fields on a website to automate boring work?
Thanks for the video @James
Can I get the details about integrating the same from react ?
@James I want to append a json object with it's values to google sheet using append. How can I do that? The rest is working fine. The only issue is I want to pass the json values be pasted in seperate columns, right now whole json object is being written to only one row as a whole.
Great tutorial, thank you! I’m wondering how to handle credentials.json? I guess you won’t commit it to the git so how would you provide this file for a deployment eg Heroku?
Was hoping this would be on the google-spreadsheet npm module, but to achieve your original goal you could have created a Google form and have the results appear in a sheet.
Very true, but I wanted to mess around with the API directly for more complex use cases in the future. Form was just a good starter example
This is too much power... really well done video! No complaints here, everything worked as you described, but maybe if you elaborated on more than just appending / reading, that would've been nice.
Thanks so much for the kind words! In hindsight, I wish I had spent more time on the actual Google Sheets API rather than the demo application - I wanted to keep the video as short as possible, so I only demonstrated the features I actually found useful in the API. I am going to write a blog post on this soon, and will make sure it demonstrates more capabilities of the API!
Can you please make a reCAPTCHA tutorial. It would be great!