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

КОМЕНТАРІ • 239

  • @BrandonClapp
    @BrandonClapp 3 роки тому +7

    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.

  • @TraumaMedia
    @TraumaMedia 2 роки тому +3

    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!

  • @t-damer
    @t-damer 2 роки тому +2

    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 💪

  • @dub161
    @dub161 Рік тому

    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.

  • @jamesgrimshaw
    @jamesgrimshaw  8 місяців тому +11

    Building something at the moment where I need to read from a Google Sheet... I'm back here reminding myself how to do it 😂

    • @AxelFerrer-sw4xs
      @AxelFerrer-sw4xs 6 місяців тому

      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.

    • @quinojuan2
      @quinojuan2 4 місяці тому

      🤣

  • @htmlfivedev
    @htmlfivedev 2 роки тому +9

    THANK YOU ... FINALLY, SOMEONE SPEAKING CLEAR ENGLISH HAS MADE A TUTORIAL ON THIS TOPIC THAT TRULY HELPS ... THANK YOU !!

  • @mohammadyusuf37
    @mohammadyusuf37 3 роки тому +5

    Thank you for such a great, crisp tutorial. This should be the goto place instead of the docs.

  • @kamenriderinfinity
    @kamenriderinfinity Рік тому

    bruh... literally what I was looking for. Thank you for making this complicated subject easy to understand.

  • @sauloferreiradossantos8158
    @sauloferreiradossantos8158 3 роки тому +10

    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!

  • @alanhunold7546
    @alanhunold7546 3 роки тому +1

    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 :)

    • @jamesgrimshaw
      @jamesgrimshaw  3 роки тому +2

      Wow thanks so much! More videos coming soon :)

  • @LongVuDucIcake
    @LongVuDucIcake 2 роки тому +2

    I tried some tutorial on the internet and fail. Then I find yours :). Thank you so much!

  • @mehrosenasir9974
    @mehrosenasir9974 10 місяців тому

    Clean, Clear, and Concise. Bravo!

  • @siriusFish1
    @siriusFish1 2 роки тому

    Thanks for this! I was bouncing around reading the docs for way too long!

  • @my_codingchannel7479
    @my_codingchannel7479 Рік тому

    You made this and the website it is about and haven't made a video since 😞...... you are a good teacher...

  • @abdulrhmanalharasis4119
    @abdulrhmanalharasis4119 3 роки тому +7

    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)

  • @zyada9334
    @zyada9334 10 місяців тому

    Thank you so much for this tutorial.
    it's perfect for me because I'm working with express and google sheets API.

  • @generalpompeyo
    @generalpompeyo 9 місяців тому +2

    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.

  • @MarcoS-bx5uk
    @MarcoS-bx5uk Рік тому

    This is great, James, it served me perfectly. Thank you.

  • @corychecketts
    @corychecketts 2 роки тому

    You are awesome. This was just what I was looking for!

  • @saulhiram2145
    @saulhiram2145 2 роки тому

    Good video, I was reading the Google Sheet API and I don't undertand but I can

  • @segunthemarketer2195
    @segunthemarketer2195 Рік тому

    This is a very very beautiful tutorial! Very detailed… 🙏🏽

  • @fabricio_zm
    @fabricio_zm 3 роки тому +2

    This was exactly what I needed Lol Thank you so much!! Great video!!

  • @vietcuongquach636
    @vietcuongquach636 2 роки тому

    u save my day!! that a really wonderful tutorial

  • @techsamar
    @techsamar 2 роки тому

    Beautifully Explained!! Thanks

  • @LiquidMasti
    @LiquidMasti 3 роки тому

    great video and content. love the teaching style keep the good work up man.

  • @zeeu
    @zeeu Рік тому +1

    best explanation I've ever seen

  • @re_allyedge
    @re_allyedge 2 роки тому +1

    Awesome video! Sad to see that you stopped making more videos.

  • @garikmelqonyan9130
    @garikmelqonyan9130 Рік тому

    Thanks for this great tutorial, James.

  • @samandaryusupov6134
    @samandaryusupov6134 4 місяці тому

    THANK YOU VEEEERRRRYYY MUCH. you are the best. i am so glad i found this vid

  • @wibu8757
    @wibu8757 Рік тому

    This video is exactly what I needed, thaks )

  • @pitchyq2804
    @pitchyq2804 2 роки тому

    Great explanation, pretty much got all i need to know. Thanks :)

  • @akritworanithiphong
    @akritworanithiphong Рік тому

    Thank you, the tutorial is nicely done. :D

  • @mfarhanarif7476
    @mfarhanarif7476 2 роки тому

    Thanks Sir, Really helpful and the way explained is awsome.

  • @cloudagnostic
    @cloudagnostic Рік тому

    Thank you! Very helpful and informative.

  • @toffotin
    @toffotin Рік тому

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

  • @rizzbod
    @rizzbod 8 місяців тому

    Great tutorial on working with Google sheet api , that is get starter for everyone. Thnx

  • @landenbrewer7319
    @landenbrewer7319 Рік тому

    This actually saved me. Thanks bor.

  • @eltonleao3979
    @eltonleao3979 3 роки тому

    Thanks! Awesome explanation!

  • @rogue1183
    @rogue1183 3 роки тому

    Wow, thanks for the tutorial!

  • @SuboptimalEng
    @SuboptimalEng 3 роки тому

    Neat idea! Imma take some notes 📖

  • @drvision-xz7ui
    @drvision-xz7ui Рік тому

    Best video. Working very well for me

  • @paulclarke4099
    @paulclarke4099 Рік тому +1

    Great video, thanks for making this so simp😀le compared to most other videos available on UA-cam 👍

  • @benny.6588
    @benny.6588 2 роки тому

    Thanks brother, this was useful for me.

  • @JuanCastro-uf6er
    @JuanCastro-uf6er 3 роки тому +3

    thnks a lot, this video is really helpful.

  • @maratiot
    @maratiot Рік тому

    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?

  • @basparshirkooh976
    @basparshirkooh976 2 роки тому

    Perfect, you saved me. THANK YOU

  • @user-qh4ht1yt5j
    @user-qh4ht1yt5j 2 роки тому

    Very good tutorial! Thank you.

  • @hugopachy2036
    @hugopachy2036 Рік тому

    Hey man! Insane tutorial thanks you ! Same a lot of time

  • @osherezra8460
    @osherezra8460 3 роки тому

    Just found out the channel, thank you keep it brother great content and flow cheers

  • @NeloReis71
    @NeloReis71 2 роки тому

    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.

  • @iBen-ry6pj
    @iBen-ry6pj 6 місяців тому

    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!

  • @phutruong9687
    @phutruong9687 Рік тому

    thank you so much. it's very helpful

  • @jacek0720
    @jacek0720 2 роки тому

    Thank You! Great job!

  • @jmpsoliz
    @jmpsoliz Рік тому

    Thanks a lot! Great video

  • @user-gu5ts5nx8r
    @user-gu5ts5nx8r 2 роки тому

    Very helpful, thank you.

  • @giwrgosiwannidis4684
    @giwrgosiwannidis4684 2 роки тому

    Great tutorial!

  • @HagbardCelineOnRust
    @HagbardCelineOnRust 3 роки тому

    gj creating a video on this. you saved me some time. ty sir

  • @patrickudeh5869
    @patrickudeh5869 Рік тому

    Simple to the point...
    Do you have any tutorial on google fit api?...

  • @juanjoroba
    @juanjoroba 11 місяців тому

    Thank you so much, idol!!

  • @beccaadolph
    @beccaadolph Рік тому

    Thank you. Wish you would have explained Express

  • @noeliapardo1605
    @noeliapardo1605 Рік тому

    good job male, thanks!

  • @user-eu3ok8dc8b
    @user-eu3ok8dc8b 5 місяців тому

    great video.thanks!!

  • @vazsa7387
    @vazsa7387 Рік тому

    this was so useful thanks

  • @vipulpawaskar
    @vipulpawaskar 3 роки тому

    Dotenv module will be helpful to hide credentials details.
    Very Helpful... Thanks for sharing

  • @keithpowell6564
    @keithpowell6564 2 роки тому +4

    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?

    • @jamesgrimshaw
      @jamesgrimshaw  8 місяців тому

      I never got around to writing a blog post on this! I want to make more videos and maybe courses in the future though

  • @amthebeast-lolsupportplays599
    @amthebeast-lolsupportplays599 2 роки тому

    Thank you for this video

  • @dejo095
    @dejo095 3 роки тому +1

    One tip for you, since you share tips with us :-) npm init -y will initialize project folder with default values for you

  • @DivitKalem
    @DivitKalem 2 роки тому

    Amazing. Thanks. 👏👏

  • @dasdunetechnologies1695
    @dasdunetechnologies1695 3 роки тому

    Very good video clear and sharp! A little question though , any idea how to delete a row with the API ? Thanks in advance.

  • @Dtomper
    @Dtomper 2 роки тому

    Thank you so much bro

  • @StratexMedia
    @StratexMedia 3 роки тому

    please make something about passport js ur explanation is really top notch

    • @jamesgrimshaw
      @jamesgrimshaw  3 роки тому

      The next series will be an authentication series!

  • @myworldbox
    @myworldbox 2 роки тому

    epic tutorials bro

  • @blink11101
    @blink11101 3 роки тому

    definitely a good video, thanks for sharing

  • @matheuseli165
    @matheuseli165 3 роки тому

    great video, thanks

  • @MarsFrom
    @MarsFrom 3 роки тому

    Thanks buddy!

  • @streamcalter442
    @streamcalter442 Рік тому

    Bro I am Missing your videos, I subscribed you with hope

  • @chirpieful
    @chirpieful 3 роки тому

    Great video!

  • @itmoroz
    @itmoroz 2 роки тому

    thank you very much !!!

  • @afp2003d
    @afp2003d 5 місяців тому

    helpful.. thanks

  • @toyinatofarati5512
    @toyinatofarati5512 2 роки тому +3

    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

  • @josebergues
    @josebergues 3 роки тому

    Great Video!

  • @brianyasierjacobofuentes1294
    @brianyasierjacobofuentes1294 2 роки тому

    fantastic !

  • @dasdunetechnologies1695
    @dasdunetechnologies1695 3 роки тому

    Another question about namedrange, they are listed in your Metadata variable but how to create a new one from the API ?

  • @leandromendoza9216
    @leandromendoza9216 2 роки тому

    Thank you !!

  • @gencbeyin34
    @gencbeyin34 3 роки тому

    I think Integromat does it easier, good tutorial btw thanks.

  • @leonardomauricio3149
    @leonardomauricio3149 2 роки тому

    Thanks!

  • @pomarpeggio
    @pomarpeggio Рік тому

    Thank you sir

  • @tonmoitanvi1773
    @tonmoitanvi1773 2 роки тому

    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.

  • @altamirsantos6030
    @altamirsantos6030 2 роки тому

    Thanks guy

  • @LucXX36
    @LucXX36 2 роки тому +1

    This is so great. Thank you.
    As long as I know adding Reactjs to this should not be a big deal isn't it?

    • @jamesgrimshaw
      @jamesgrimshaw  8 місяців тому +1

      Convert the node.js app to an API, and then use fetch calls to integrate with a React.js app. Should be straightforward :)

  • @JumpingDaNieL1
    @JumpingDaNieL1 2 роки тому

    Nice Video! Please tell me, how i can read the values in sheets and use with aplications to for example show in div?

  • @luisforni86
    @luisforni86 3 роки тому

    Hello, how can you make a FOR loop with 2 columns, for example phone number and message to send?

  • @manuelrivera3646
    @manuelrivera3646 2 роки тому

    Muchas gracias

  • @astrotecn
    @astrotecn 2 роки тому

    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?

  • @premkumar01
    @premkumar01 9 місяців тому

    Thanks for the video @James
    Can I get the details about integrating the same from react ?

  • @syedaffan2104
    @syedaffan2104 2 роки тому

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

  • @nemethricsi
    @nemethricsi 2 роки тому

    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?

  • @Angelusundertaker666
    @Angelusundertaker666 2 роки тому

    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.

    • @jamesgrimshaw
      @jamesgrimshaw  8 місяців тому

      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

  • @diggitydingdong
    @diggitydingdong 3 роки тому +1

    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.

    • @jamesgrimshaw
      @jamesgrimshaw  3 роки тому +2

      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!

  • @giwrgosiwannidis4684
    @giwrgosiwannidis4684 2 роки тому

    Can you please make a reCAPTCHA tutorial. It would be great!