Control Google Sheets with Node.js / JavaScript (v4 API)

  Рет қаралды 126,874

James Grimshaw

James Grimshaw

Күн бұрын

Пікірлер: 245
@jamesgrimshaw
@jamesgrimshaw Жыл бұрын
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 Жыл бұрын
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 11 ай бұрын
🤣
@ravipatelCTF
@ravipatelCTF 2 ай бұрын
😂😂😂 A little RECURSIVE approach , isn't it. The Tutorial creator himself uses his own tutorial to build something.
@htmlfivedev
@htmlfivedev 3 жыл бұрын
THANK YOU ... FINALLY, SOMEONE SPEAKING CLEAR ENGLISH HAS MADE A TUTORIAL ON THIS TOPIC THAT TRULY HELPS ... THANK YOU !!
@sauloferreiradossantos8158
@sauloferreiradossantos8158 3 жыл бұрын
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!
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
Appreciate you watching! :)
@TraumaMedia
@TraumaMedia 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!
@BrandonClapp
@BrandonClapp 3 жыл бұрын
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.
@a.alharasis
@a.alharasis 3 жыл бұрын
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)
@jamesgrimshaw
@jamesgrimshaw Жыл бұрын
Great point :)
@t-damer
@t-damer 3 жыл бұрын
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 💪
@LongVuDucIcake
@LongVuDucIcake 3 жыл бұрын
I tried some tutorial on the internet and fail. Then I find yours :). Thank you so much!
@mohammadyusuf37
@mohammadyusuf37 3 жыл бұрын
Thank you for such a great, crisp tutorial. This should be the goto place instead of the docs.
@dub161
@dub161 2 жыл бұрын
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.
@alanhunold7546
@alanhunold7546 3 жыл бұрын
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 жыл бұрын
Wow thanks so much! More videos coming soon :)
@generalpompeyo
@generalpompeyo Жыл бұрын
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.
@kamenriderinfinity
@kamenriderinfinity 2 жыл бұрын
bruh... literally what I was looking for. Thank you for making this complicated subject easy to understand.
@my_codingchannel7479
@my_codingchannel7479 2 жыл бұрын
You made this and the website it is about and haven't made a video since 😞...... you are a good teacher...
@mehrosenasir9974
@mehrosenasir9974 Жыл бұрын
Clean, Clear, and Concise. Bravo!
@siriusFish1
@siriusFish1 2 жыл бұрын
Thanks for this! I was bouncing around reading the docs for way too long!
@fabricio_zm
@fabricio_zm 3 жыл бұрын
This was exactly what I needed Lol Thank you so much!! Great video!!
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
So glad you found it useful! :)
@iBen-ry6pj
@iBen-ry6pj Жыл бұрын
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!
@saulhiram2145
@saulhiram2145 3 жыл бұрын
Good video, I was reading the Google Sheet API and I don't undertand but I can
@avalancherelapse
@avalancherelapse 2 жыл бұрын
8:15 when i do "nodemon index.js" it tells me that "nodemon" is an unknown command, even though i installed the package. what's going on?
@zyada9334
@zyada9334 Жыл бұрын
Thank you so much for this tutorial. it's perfect for me because I'm working with express and google sheets API.
@re_allyedge
@re_allyedge 3 жыл бұрын
Awesome video! Sad to see that you stopped making more videos.
@zeeu
@zeeu 2 жыл бұрын
best explanation I've ever seen
@MarcoS-bx5uk
@MarcoS-bx5uk 2 жыл бұрын
This is great, James, it served me perfectly. Thank you.
@vietcuongquach636
@vietcuongquach636 3 жыл бұрын
u save my day!! that a really wonderful tutorial
@corychecketts
@corychecketts 2 жыл бұрын
You are awesome. This was just what I was looking for!
@rizzbod
@rizzbod Жыл бұрын
Great tutorial on working with Google sheet api , that is get starter for everyone. Thnx
@dejo095
@dejo095 3 жыл бұрын
One tip for you, since you share tips with us :-) npm init -y will initialize project folder with default values for you
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
Great tip!
@LiquidMasti
@LiquidMasti 3 жыл бұрын
great video and content. love the teaching style keep the good work up man.
@segunthemarketer2195
@segunthemarketer2195 2 жыл бұрын
This is a very very beautiful tutorial! Very detailed… 🙏🏽
@keithpowell6564
@keithpowell6564 3 жыл бұрын
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 Жыл бұрын
I never got around to writing a blog post on this! I want to make more videos and maybe courses in the future though
@NeloReis71
@NeloReis71 3 жыл бұрын
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.
@toffotin
@toffotin 2 жыл бұрын
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...
@pjc825
@pjc825 2 жыл бұрын
Great video, thanks for making this so simp😀le compared to most other videos available on KZbin 👍
@toyinatofarati5512
@toyinatofarati5512 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
@garikmelqonyan9130
@garikmelqonyan9130 2 жыл бұрын
Thanks for this great tutorial, James.
@maratiot
@maratiot 2 жыл бұрын
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?
@SuboptimalEng
@SuboptimalEng 3 жыл бұрын
Neat idea! Imma take some notes 📖
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
So cool isn’t it!!
@samandaryusupov6134
@samandaryusupov6134 11 ай бұрын
THANK YOU VEEEERRRRYYY MUCH. you are the best. i am so glad i found this vid
@vipulpawaskar
@vipulpawaskar 3 жыл бұрын
Dotenv module will be helpful to hide credentials details. Very Helpful... Thanks for sharing
@melihkarakaya79
@melihkarakaya79 3 жыл бұрын
how to do that?
@osherezra8460
@osherezra8460 3 жыл бұрын
Just found out the channel, thank you keep it brother great content and flow cheers
@techsamar
@techsamar 3 жыл бұрын
Beautifully Explained!! Thanks
@volatilnost
@volatilnost Ай бұрын
thank you! Amasing tutorial!
@akritworanithiphong
@akritworanithiphong 2 жыл бұрын
Thank you, the tutorial is nicely done. :D
@patrickudeh5869
@patrickudeh5869 2 жыл бұрын
Simple to the point... Do you have any tutorial on google fit api?...
@wibu8757
@wibu8757 2 жыл бұрын
This video is exactly what I needed, thaks )
@mfarhanarif7476
@mfarhanarif7476 3 жыл бұрын
Thanks Sir, Really helpful and the way explained is awsome.
@jean-louisgouwy
@jean-louisgouwy 2 жыл бұрын
You helped me a lot. Thx Little question, I just created a new google spread sheet. I received my 200, but it seems that only the "account service" from the api key has an access to it. Which is weird because my main account is responsible of the account service. Any idea ?
@jean-louisgouwy
@jean-louisgouwy 2 жыл бұрын
For those who wonder the same question : you need to use the GDrive Api. After creating the file with account service, you need to use : developers.google.com/drive/api/v3/reference/permissions/create ``` const result = await googleSheets.spreadsheets.create(params); const fileId = result.data.spreadsheetId; drive = google.drive({ version: "v3", auth }); const res = await drive.permissions.create({ resource: { type: "user", //role: "owner", role: "writer", emailAddress: "xxxx" // Set the email address you want to give the permission. }, fileId: fileId, fields: "id", //transferOwnership: true, }); ``` Still have an issue with ownership that i need to fix with the above code : Consent is required to transfer ownership of a file to another user.
@landenbrewer7319
@landenbrewer7319 2 жыл бұрын
This actually saved me. Thanks bor.
@dev_danny
@dev_danny 2 жыл бұрын
Great explanation, pretty much got all i need to know. Thanks :)
@smilyking6595
@smilyking6595 3 жыл бұрын
First of all, thank you for your video, it helped me alot! Sadly I have an issue with my authentification. When I try to start the server/ refresh the server at the point of minute 13 and reload the Website in my browser, the site can not load. In VS Code I get an error. message: ‘Invalid Credentials’, domain: ‘global’, reason: ‘authError’, location: ‘Authorization’, locationType: ‘header’ Unfortunately I have no clue where and what went wrong. My Code looks identical. Maybe you or some else can help me out. Thank you in advance! And greetings from germany Malte
@hugopachy2036
@hugopachy2036 2 жыл бұрын
Hey man! Insane tutorial thanks you ! Same a lot of time
@HagbardCelineOnRust
@HagbardCelineOnRust 3 жыл бұрын
gj creating a video on this. you saved me some time. ty sir
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
Appreciate you watching! :)
@JuanCastro-uf6er
@JuanCastro-uf6er 3 жыл бұрын
thnks a lot, this video is really helpful.
@rogue1183
@rogue1183 3 жыл бұрын
Wow, thanks for the tutorial!
@cloudagnostic
@cloudagnostic Жыл бұрын
Thank you! Very helpful and informative.
@beccaadolph
@beccaadolph 2 жыл бұрын
Thank you. Wish you would have explained Express
@premkumar01
@premkumar01 Жыл бұрын
Thanks for the video @James Can I get the details about integrating the same from react ?
@aryupanchal
@aryupanchal 3 жыл бұрын
please make something about passport js ur explanation is really top notch
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
The next series will be an authentication series!
@drvision-xz7ui
@drvision-xz7ui Жыл бұрын
Best video. Working very well for me
@dasdunetechnologies1695
@dasdunetechnologies1695 3 жыл бұрын
Another question about namedrange, they are listed in your Metadata variable but how to create a new one from the API ?
@Jurinza55
@Jurinza55 2 жыл бұрын
producer's version? I just want to make sure I get the right one for .
@Jonas-sg1eo
@Jonas-sg1eo 2 жыл бұрын
I only have ones question how to install googleapis on server ? is there are import link or something to import on index.html ?
@pavelvisek4374
@pavelvisek4374 3 жыл бұрын
8:19 I have this error: nodemon : The term 'nodemon' is not recognized as t he name of a cmdlet, function, script file, or oper able program. Check the spelling of the name, or if a path was included, verify that the path is corre ct and try again. At line:1 char:1 + nodemon index.js + ~~~~~~~ + CategoryInfo : ObjectNotFound: (nod emon:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundExcep tion please help
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
You don’t have nodemon installed - recheck the part where we npm install various packages
@pavelvisek4374
@pavelvisek4374 3 жыл бұрын
@@jamesgrimshaw ok, but i type in terminal npm install -D nodemon and it saw it is installed, but is a nodemon really needed? I haven't watched whole video yet xd
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
@@pavelvisek4374 Nope you don’t need it, just makes development easier because you don’t have to stop the server and restart it again every time you make changes
@pavelvisek4374
@pavelvisek4374 3 жыл бұрын
@@jamesgrimshaw do you have discord? I would really appreciate it if I could learn something or ask something without having to write in the comments
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
@@pavelvisek4374 sure my discord is jamesgrimshaw#2024
@primebreaker4839
@primebreaker4839 3 жыл бұрын
The metaData variable isn't working for me. I think it is to do with the spreadsheet Id but I have already given the bot access to the spreadsheet so I am not sure what's up with it
@saikrishnavs7886
@saikrishnavs7886 2 жыл бұрын
hey james...Thanks for the video but what if iam creating the spread sheet through a api call and i need to grand the permission for the service account. For me it is not possible to share the permission manually cause im creating the spread sheet through api call itself
@basparshirkooh976
@basparshirkooh976 2 жыл бұрын
Perfect, you saved me. THANK YOU
@adityavartak007
@adityavartak007 2 жыл бұрын
Cant get the metadata, the keyFile parameter in my client object is undefined?
@BusterBrown1217
@BusterBrown1217 2 жыл бұрын
How would I go about deleting the second row and moving every row below it up? Is that feasible?
@eltonleao3979
@eltonleao3979 3 жыл бұрын
Thanks! Awesome explanation!
@astrotecn
@astrotecn 3 жыл бұрын
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?
@developeraccount438
@developeraccount438 2 жыл бұрын
can be all new column and update the entere value later?
@Jonas-sg1eo
@Jonas-sg1eo 2 жыл бұрын
when i push this to my browser/client-side i get error "require is not defined"
@aronrestyramillano1321
@aronrestyramillano1321 3 жыл бұрын
Hello! So I am trying to make it so that this specific index.js file that handles the sending of data to the google sheets, is called by another normal .js file question is, how I will pass data to it and have it get triggered by a specific event, to go an append the data, to my google sheets? without using the .ejs button that you have created
@smileguptaaa
@smileguptaaa 3 жыл бұрын
How can we add background color to the sheet cell?
@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.
@rohitraj2321
@rohitraj2321 2 жыл бұрын
hey mate... i was trying to create an app to allow users to edit their sheets itslef. how can i do that?
@luisforni86
@luisforni86 3 жыл бұрын
Hello, how can you make a FOR loop with 2 columns, for example phone number and message to send?
@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?
@JumpingDaNieL1
@JumpingDaNieL1 3 жыл бұрын
Nice Video! Please tell me, how i can read the values in sheets and use with aplications to for example show in div?
@MinhThongLe
@MinhThongLe 2 жыл бұрын
I wonder when you deploy your app. So other users can have the right to write into google sheet ?. Thanks
@streamcalter442
@streamcalter442 2 жыл бұрын
Bro I am Missing your videos, I subscribed you with hope
@koteshmeesala1630
@koteshmeesala1630 3 жыл бұрын
How did you prettify the json in the browser page
@Angelusundertaker666
@Angelusundertaker666 3 жыл бұрын
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 Жыл бұрын
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
@jacek0720
@jacek0720 2 жыл бұрын
Thank You! Great job!
@Christopher-ew7jw
@Christopher-ew7jw 3 жыл бұрын
How do you use a keyFile with Netlify without including your keyFile in your version control?
@ИкболжонИсаков-п7д
@ИкболжонИсаков-п7д 3 жыл бұрын
Very good tutorial! Thank you.
@diggitydingdong
@diggitydingdong 3 жыл бұрын
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 жыл бұрын
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!
@toshunigam8603
@toshunigam8603 2 жыл бұрын
could anyone help why i am getting this response. "data": { "error": { "code": 404, "message": "Requested entity was not found.", "errors": [ { "message": "Requested entity was not found.", "domain": "global", "reason": "notFound" } ], "status": "NOT_FOUND" } } i wand to read the sheet
@DionnyPrensa
@DionnyPrensa 3 жыл бұрын
Awesome. Thanks a lot. I have a question. If I have to update a specific row, would I have to read the entire sheet to then know the position of the row that I have to update? or is there some other way?
@jamesgrimshaw
@jamesgrimshaw 3 жыл бұрын
Well in order to update a specific row, you will need to know the row number, which you can then specify as part of the range, using the "update" function rather than append, which works in the same way but the function is called update rather than append. For example, if the row you want to update is row 7, you would use append like in the video but set the range as "Sheet1!A7:B7", or whatever column range you want to use (B7:C7 or A7:D7, etc.) Hope this helps, thanks for watching!
@oqykz
@oqykz 5 ай бұрын
рахмет, Жеміс
@thekevalpanchal
@thekevalpanchal Жыл бұрын
Can we upload files on Google sheet from registation form when user upload it
@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.
@varma8669
@varma8669 2 жыл бұрын
I really like your vscode setup. How did you get the arrow shape on your terminal ?
@jamesgrimshaw
@jamesgrimshaw Жыл бұрын
My terminal is like that because of something called ohmyzsh. I think the plugin was called Powerlevel10k
@misterl8129
@misterl8129 11 ай бұрын
Hi! Great video. It worked for me. I have a question tho. The read of the csv WORKS just if I have a csv with just 1 sheet. I have another with 3 sheets and when i Try to get the values says errors: [ { message: 'This operation is not supported for this document', domain: 'global', reason: 'failedPrecondition' } ] what could it be?
@misterl8129
@misterl8129 11 ай бұрын
Nevermind. I diplucated the file, get that id and work. Weird tho
@phutruong9687
@phutruong9687 2 жыл бұрын
thank you so much. it's very helpful
@LucXX36
@LucXX36 3 жыл бұрын
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 Жыл бұрын
Convert the node.js app to an API, and then use fetch calls to integrate with a React.js app. Should be straightforward :)
@kevenmendes3670
@kevenmendes3670 Жыл бұрын
When I run i in my local machine it's working well, but i sent it to git hub and published with github pages. But it isn't working online, I don't know why. The pages redirect to an error: 405 Not Allowed And I receive a console error that says. POST ... 405
@melihkarakaya79
@melihkarakaya79 3 жыл бұрын
Thanks for the tutorial! How should we hide the credentials while also serving them to the nodejs file?
@developerGRohit
@developerGRohit 3 жыл бұрын
by using .env kzbin.info/www/bejne/a4ipqpupo7pnf80&ab_channel=SteveGriffith-Prof3ssorSt3v3
@miraclehesed8959
@miraclehesed8959 3 жыл бұрын
Hi, thanks for the solution at hand but i have a problem. When I console.log the metaData.data, the object "sheets" returns this sheets: [ { properties: [Object] } ]. What seems to be the problem.
@miraclehesed8959
@miraclehesed8959 3 жыл бұрын
Okay it's resolved.
Google Sheets - JSON API, Wep App - e.j1 p.1
23:04
Get __it Done!
Рет қаралды 36 М.
NodeJS & Express - Google OAuth2 using PassportJS
20:33
Kris Foster
Рет қаралды 111 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
How to build a Contact Form in Node.js and Google Sheets?
37:02
Max Programming
Рет қаралды 7 М.
Google Sheets API Automation in Python
26:36
NeuralNine
Рет қаралды 98 М.
Google Sheets & NextJS
30:52
Icodestuff
Рет қаралды 22 М.
Automate Google Sheets With Python - Google Sheets API Tutorial
32:28
Google Sheets - Python API, Read & Write Data
28:01
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 194 М.
Master Google Sheets with Node.js: Read & Write Data Effortlessly!
14:28
Google Sheets… Your Next Database?
7:16
Fireship
Рет қаралды 413 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
How to update Google Sheets using JavaScript and Node JS  - Google Sheets API
12:58
Convert Google Sheets into a REST API
14:10
Better Sheets
Рет қаралды 16 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН