Google Sheets and JavaScript with Node.js

  Рет қаралды 231,872

Twilio

Twilio

Күн бұрын

Пікірлер: 249
@twilio
@twilio 4 жыл бұрын
🔥 WATCH NEXT: Build an Animal Crossing price lookup bot with Google Sheets and WhatsApp kzbin.info/www/bejne/m6LXgmpsjcSirbM
@nexoska
@nexoska 4 жыл бұрын
Hey!, i have a question, how can you throw an error message, if the query fails?
@RendallRen
@RendallRen 5 жыл бұрын
Not only is this video informative, it could be the gold standard for all programming demonstration videos. Tight editing, brisk pacing, considerate of the viewer's time. Nice!
@twilio
@twilio 5 жыл бұрын
Thanks for watching Rendall and for the kind words!
@twilio
@twilio 5 жыл бұрын
Let us know if there's any videos you want to see us make. We'd be happy to oblige.
@RendallRen
@RendallRen 5 жыл бұрын
@@twilio I would love to see a video exploring methods of managing state in an interactive text messaging session or phone tree, especially if it could persist over time, perhaps days.
@AhmadAwais
@AhmadAwais 5 жыл бұрын
Literally the best tutorial on Spreadsheets + Node.js topic. Kudos, folks you nailed it. Give that man a raise! 👌
@twilio
@twilio 5 жыл бұрын
Thanks for watching Ahmad! Let us know if there's ever a video you want us to produce.
@DudeBroVideos
@DudeBroVideos 3 жыл бұрын
dang this man gets straight to the point and shows all of what you probably would want to do, very epic.
@lskaling
@lskaling 2 жыл бұрын
For anyone stuck not being able to download the client secret JSON file, it's changed since the video was made. After creating the service account click on it in credentials, go to keys, and then select "add key" and it will download.
@johnvargo8050
@johnvargo8050 Жыл бұрын
Thanks for this.
@Mtber_420
@Mtber_420 Жыл бұрын
Thank you🙏
@brunopuccio9535
@brunopuccio9535 5 жыл бұрын
this is the best programming tutorial i have ever seen, dude you are awesome
@AdeelImranr
@AdeelImranr 5 жыл бұрын
To the point, concise & very well delivered. I loved everything about this video. Thank you team Twilio
@twilio
@twilio 5 жыл бұрын
Thanks for the kind words... we're so happy you loved it!
@adityak1231
@adityak1231 4 жыл бұрын
At 4:49 I'm getting an error "TypeError: GoogleSpreadsheet is not a constructor". How do I fix it? The code is exactly what is shown.
@jannopotestades3205
@jannopotestades3205 4 жыл бұрын
same error how do we fix this?
@Jimmy-rh5lk
@Jimmy-rh5lk 4 жыл бұрын
same
@Jimmy-rh5lk
@Jimmy-rh5lk 4 жыл бұрын
npm install google-spreadsheet@2.0.6
@Jimmy-rh5lk
@Jimmy-rh5lk 4 жыл бұрын
how to fix ^^
@starkiller1092
@starkiller1092 4 жыл бұрын
to import google-spreadsheets you need const { GoogleSpreadsheet } = require('google-spreadsheet');
@mo3k
@mo3k 5 жыл бұрын
This video should be the new gold standard for how to introduce any new API by video. And it’s not even Twilio’s API!
@elmercin
@elmercin 5 жыл бұрын
Came here looking for copper and found gold, great tutorial!
@twilio
@twilio 5 жыл бұрын
Happy to help! Let us know if there’s more gold we can help you mine.
@basilerommes1650
@basilerommes1650 4 жыл бұрын
Why did you select Google Drive API and not Google Sheets API at 0:33?
@Sunsets5000
@Sunsets5000 3 жыл бұрын
This was brilliant. I'm new to Javascript and have been looking everywhere for an accessible guide to interacting with Googlesheets. This was simple, effective and SUPER informative. Thanks! One thing to note, the code throws an error in the most recent version of Java. I had to install 2.0.6
@twilio
@twilio 3 жыл бұрын
Glad it was helpful Michael!
@dimkir100
@dimkir100 5 жыл бұрын
Great tut, but one improvement: When calling row.save() you need a callback to handle errors. Eg. row.save(err=>{ if (err) return console.error(err); // else all is good })
@twilio
@twilio 5 жыл бұрын
Great suggestion. We sometimes leave out error checks for brevity in the videos but I’d definitely suggest adding that one!
@LuisRuizHalo
@LuisRuizHalo 5 жыл бұрын
Love this format of vids. Simple, quick and dynamic. You just got another sub.
@weyauh4338
@weyauh4338 5 жыл бұрын
I watched your amazing Pyhon + GSheets video and made an application that tracks stock prices. I want to learn JS some time in the future, so I probably will come back to this video then! Thank you!
@twilio
@twilio 5 жыл бұрын
I’m glad I could help! Let me know what you build 😀
@weyauh4338
@weyauh4338 5 жыл бұрын
@@twilio this channel is not run by a single person, right? The production and video quality is impeccable!
@PhilNash
@PhilNash 5 жыл бұрын
@@weyauh4338 Hey, I work for Twilio and Brent is in fact behind the majority of the technical videos you see in this channel. I'm hoping to learn from his techniques and start producing videos myself, but it is a bit intimidating!
@rahulkuchhadia8329
@rahulkuchhadia8329 4 жыл бұрын
How I can add multiple queries? any idea?
@sr_aman
@sr_aman 5 жыл бұрын
Gold standard for tutorials.
@developerspoot
@developerspoot 4 жыл бұрын
Could you make a new video on the updated version of spreadsheet?
@RTCDigitalS
@RTCDigitalS 2 жыл бұрын
The tutorial was awesome. Thank you. The only thing missing is how to color rows, that would have been all I needed for my project! Thanks once again.
@KostasOreopoulos
@KostasOreopoulos 5 жыл бұрын
Really great video. Compact and informative. Easy to QuickStart exploring the api
@twilio
@twilio 5 жыл бұрын
Thanks for the kind words and thanks for watching!
@geebsayshi
@geebsayshi 3 жыл бұрын
this video just saved my career thank you
@zekewolf6877
@zekewolf6877 5 жыл бұрын
This tutorial is outstanding! Keep up the great work!
@twilio
@twilio 5 жыл бұрын
Thanks for watching and for the kind words!
@zekewolf6877
@zekewolf6877 5 жыл бұрын
@@twilio Do you happen to have any documentation on querying rows that match a certain condition? I can't seem to find anything on it. Thanks!
@twilio
@twilio 5 жыл бұрын
I believe batchGetByDataFilter will get you what you need: developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter
@VitoFabrizioBrugnola
@VitoFabrizioBrugnola 3 жыл бұрын
I have triple check I copied your code exactly, but i get "UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block" I do not why :(. Can you help me?
@milktea3192
@milktea3192 4 жыл бұрын
Thank you for the amazing video. I understand this is a old video but when i'm working on it error pop outs and said googleSpreadsheet is not a constructor is there any way to solve this?
@mikalmorello7768
@mikalmorello7768 4 жыл бұрын
I reverted to version 2.0.6 of the google-spreadsheet npm package as a test, and it worked. Looks like the updated package version broke this functionality
@mikalmorello7768
@mikalmorello7768 4 жыл бұрын
I tried following the readme on the lastest version of the NPM package and that works as well www.npmjs.com/package/google-spreadsheet
@milktea3192
@milktea3192 4 жыл бұрын
@@mikalmorello7768 Ok thank you so much! I'll try it later
@zachwhite8054
@zachwhite8054 4 жыл бұрын
@@mikalmorello7768 This worked, thanks!
@souvikpal106
@souvikpal106 3 жыл бұрын
@@mikalmorello7768 Brother, when I console.log(rows) after await sheet.getRows() it print JSON not OBJECT.... how to fix that?
@tahsinature
@tahsinature 5 жыл бұрын
expecting more vids like this
@twilio
@twilio 5 жыл бұрын
Thanks for watching!
@omerpnar4700
@omerpnar4700 4 жыл бұрын
Thanks for the old version of API(v3), do you think make new video about new version of spreadsheet API (v4)
@omarruder4129
@omarruder4129 Жыл бұрын
Awesome! Is there any way to do this with user selected spreadsheets without the service account?
@simplyfabian
@simplyfabian 5 жыл бұрын
Really good video on a nice topic, definitely bookmarked for later use when I am planning new NodeJs projects ^_^ Have a great day!
@naveenk2k
@naveenk2k 5 жыл бұрын
Can you add the URL of the example spreadsheet used in the video? I can't seem to find it with a simple google search.
@tofa8608
@tofa8608 3 жыл бұрын
I love your tutorial and Ive tried to follow it up. I have error at 4:50 saying that "Error: Cannot find module './credentials.json'". Any way to fix it?
@jorgekunrath1016
@jorgekunrath1016 5 жыл бұрын
wow this looks awesome, wondering if I could use a spreadsheet as a database for a ecommerce
@twilio
@twilio 5 жыл бұрын
There will be potential performance issues with this at scale. I like this for small projects or internal prototyping. It’s also very useful for working with data that stems from collaboration that’s already occurring in Sheets.
5 жыл бұрын
Superb! Awesome video. Thanks a lot for sharing! :)
@twilio
@twilio 5 жыл бұрын
You’re welcome, thanks for watching!
@sentry404.
@sentry404. 5 жыл бұрын
Cheers for your time my man!
@twilio
@twilio 5 жыл бұрын
Thanks for watching Doug!
@jobayersajal1456
@jobayersajal1456 3 жыл бұрын
Why are you working with google drive API when the sheet API is the thing you need?
@twilio
@twilio 5 жыл бұрын
Got a Google Sheet that you need to access from your code? Let us know if this guide helped you get it done!
@LyonPercival
@LyonPercival 5 жыл бұрын
Nice guide! I'm just a newbie with js and Node and wanting to start on React. If anything, it'd really help making a vid since there're no React-Google Sheets API out there at all
@Ulvis_B
@Ulvis_B 5 жыл бұрын
but is safe to use?
@karlkokosboll771
@karlkokosboll771 4 жыл бұрын
The query function seems to have been deprecheated with the release of V4, do you know of any other way to only get rows with specific data values?
@rakibulhasan8654
@rakibulhasan8654 3 жыл бұрын
Hi, were you able to get a solution for this?
@karlkokosboll771
@karlkokosboll771 3 жыл бұрын
@@rakibulhasan8654 Nope, sadly
@itzblinkzy1728
@itzblinkzy1728 3 жыл бұрын
You enabled the wrong api I was stuck on this error for a long time 0:32 :(
@ramzirabahhazila8629
@ramzirabahhazila8629 5 жыл бұрын
The greatest tutorial thank you so much
@musheerahmed5815
@musheerahmed5815 3 жыл бұрын
Thanks a lot. This was really helpful.
@twilio
@twilio 3 жыл бұрын
Thanks for watching and very glad we could help!
@larissacury7714
@larissacury7714 Жыл бұрын
What about the opposite process? Is it possible to have a Js in Visual Code and collect data sendind this data to a Google Sheet ?
@JarodWilliam
@JarodWilliam 5 жыл бұрын
I really need help. I'm following these steps, but when I share the Sheet with the service account, it says that the account does not exist
@twilio
@twilio 5 жыл бұрын
I don’t think it ever says the account exists. It should still work.
@JarodWilliam
@JarodWilliam 5 жыл бұрын
@@twilio Still doesn't work, but I found another way.
@brunopuccio9535
@brunopuccio9535 5 жыл бұрын
what if there was an image uploaded in the cell? how would you do to get the url
@twilio
@twilio 5 жыл бұрын
Been trying to figure this out for you. I keep getting back an empty result for that field though.
@jmdp87aus
@jmdp87aus 4 жыл бұрын
Could I use this same approach to display data from a spreadsheet dynamically on a site?
@oatznsquats
@oatznsquats 3 жыл бұрын
why do you use the google drive api and not the google sheets api? the tutorial i was looking at said to use the google sheet api
@maxoys45
@maxoys45 5 жыл бұрын
Thanks a lot for this, worked exactly as explained. You went very quickly so had to pause the video a fair bit but that's still preferable to unedited dev videos.
@twilio
@twilio 5 жыл бұрын
Trying to strike that balance is very difficult. Focus for future videos is to make sure the pacing is quick enough that it doesn’t drag on but not so fast that you have to pause too too much. Also, more github repos/gists.
@maxoys45
@maxoys45 5 жыл бұрын
@@twilio Nice one! keep it up
@usymmij
@usymmij 5 жыл бұрын
this is a better tutorial than google has
@sriharsharevu4316
@sriharsharevu4316 4 жыл бұрын
BTW do we need to buy the subscription of google api or is it free?
@wizlee-dev
@wizlee-dev 5 жыл бұрын
Hi Twilio, why do we need to use promisfy, async and await? Cause it seems if we always await it will be the same as calling them synchronously?
@twilio
@twilio 5 жыл бұрын
This is a good question. There are definitely use cases where you won’t always want to await. Some of these operations take a while with bigger data sets. The main reason we’re promisifying this SDK is mostly to modernize it a bit. It is not very fun to work with its callbacks so the promises streamline things a bit.
@wizlee-dev
@wizlee-dev 5 жыл бұрын
@@twilio that makes sense. Thanks!
@deepaktv8280
@deepaktv8280 2 жыл бұрын
If we have json file and bunch of data then how to push all json data to google sheet via nodejs reply soon
@kartikeyaagrawal7301
@kartikeyaagrawal7301 4 жыл бұрын
The spreadsheet key is different and shorter if you try to upload xls sample sheet on drive and then open it via Google Spreadsheet .If u use a spreadsheet created by google spreadsheet in the first place the key is different and long .Why is it so ? Thank you
@Thoothje_
@Thoothje_ 4 жыл бұрын
Is there a possible way to put JavaScript back in a link what is shared. But the owner of the link. Blocked all kind of JavaScripts ?.
@JackYehWins
@JackYehWins 4 жыл бұрын
Fantastic Tutorial! Was able to combine this with a chrome extension to pull data from the dom and reduce time spent by 90%. Thank you! Ran into an issue where rows are added in random order. Are you familiar with a way to order rows when writing to csv?
@JPilsonSumbo
@JPilsonSumbo 4 жыл бұрын
Amazing... Thanks a lot , but now here trying to figure out how to add at position 2 instead of adding to the end . Any suggestions¿
@aryupanchal
@aryupanchal 3 жыл бұрын
what does the double brackets in line 8 mean??
@wholebitmedia
@wholebitmedia 4 жыл бұрын
Thia line inside the console.log appears in monocolor string code inside vsc: console.log('Title: ${sheet.title}, Rows: ${sheet.rowCount}'); And when run in terminal just showed the string with no data from the vars?
@InternetFamousYoutuber
@InternetFamousYoutuber 3 жыл бұрын
What if you want to pull/push data across multiple tabs? How would you specify the tab?
@BrentAtTwilio
@BrentAtTwilio 3 жыл бұрын
Each "tab" is a "sheet" in the spreadsheet. You can get a specific sheet by calling: const sheet = doc.sheetsByIndex[0]; This gets the first sheet. To get the second, specify [1] instead of [0]. Then you would work with that sheet as shown in this example.
@mounaboudjelida4932
@mounaboudjelida4932 5 жыл бұрын
Hi..thanks for this great tuto, i want to add a new column to the sheet from my nodejs code, is there any way to do that please?
@karl_kokosboll924
@karl_kokosboll924 4 жыл бұрын
Something isn’t working for me, the console just says “GoogleSpreadsheet is not a constructor” what have I done wrong?
@karl_kokosboll924
@karl_kokosboll924 4 жыл бұрын
I managed to get it fixed, if you have a similar problem just google the error message and you’ll quickly find a solution
@bumblebytrox6783
@bumblebytrox6783 5 жыл бұрын
Hi I'm getting this error; TypeError: Cannot set property 'jwtClient' of undefined at useServiceAccountAuth (C:\Users\*****\** ode_modules\google-spreadsheet\lib\GoogleSpreadsheet.js:53:20)
@KanagawaMarcos
@KanagawaMarcos 5 жыл бұрын
did you solve it?
@bumblebytrox6783
@bumblebytrox6783 5 жыл бұрын
@@KanagawaMarcos nope ;(
@philippschweizer6556
@philippschweizer6556 5 жыл бұрын
I am too getting this error. I think it has something to do with the dependency "google-spreadsheet". It has been updated with breaking changes. I wasn't able to fix it yet.
@KanagawaMarcos
@KanagawaMarcos 5 жыл бұрын
I've managed to get through it doing the authentication using OAuth2 instead of JWT. If you guys are interested, I can share my code.
@bumblebytrox6783
@bumblebytrox6783 5 жыл бұрын
Marcos C. Santos I would love that.
@eninamtako8036
@eninamtako8036 4 жыл бұрын
Hi thank you for the video ! I'm wonderign how to get a column name that has space in it ?
@ezteco4899
@ezteco4899 5 жыл бұрын
Sorry, I am a newbie. What is the function of doing this?
@motsgar
@motsgar 5 жыл бұрын
Explain more, i don't understand your problem
@twilio
@twilio 5 жыл бұрын
This allows you to access, store, and modify data in Google Sheets spreadsheets.
@ezteco4899
@ezteco4899 5 жыл бұрын
@@twilio so it can be like a database?
@paulopacitti
@paulopacitti 5 жыл бұрын
What's the name of this theme on your text editor?
@twilio
@twilio 5 жыл бұрын
It's called Quiet Light. I believe it was built in to VS Code.
@morrisondoll
@morrisondoll 5 жыл бұрын
Hello!!! Thank you very much for the video. I have a doubt, with the query field how can I get rows where there is an empty field and vice versa.
@ibrarramzanmalik7663
@ibrarramzanmalik7663 4 жыл бұрын
It helped me! Thank you! so much!!!
@rahulkuchhadia8329
@rahulkuchhadia8329 4 жыл бұрын
How I can add multiple queries? any idea?
@techWithSaifullah
@techWithSaifullah 4 жыл бұрын
*Excellent Video*
@twilio
@twilio 4 жыл бұрын
Thanks for watching!
@navedakther4039
@navedakther4039 4 жыл бұрын
Bro any way to contact you actually I have some questions ?
@maze42d
@maze42d 4 жыл бұрын
Is there a big latency? Like could I update data in the spreadsheet every 100ms or something around that with data from multiple sensors etc.?
@RaviAnandinfo
@RaviAnandinfo 5 жыл бұрын
Thanks a lot for a super tutorial. question: can we do it without sharing to an account? I mean manipulating data with API key only?
@twilio
@twilio 5 жыл бұрын
I believe I remember reading somewhere that if the access is set to "anyone with a link can edit" it will work but I have not tried it personally.
@RaviAnandinfo
@RaviAnandinfo 5 жыл бұрын
@@twilio thanks for quick response. :)
@twilio
@twilio 5 жыл бұрын
Sure thing! Let me know if it works for you.
@developerspoot
@developerspoot 4 жыл бұрын
Can you make an updated video on v4 google-sheets?
@shravangourishetty7556
@shravangourishetty7556 5 жыл бұрын
hello twillo iam getting an error (node:6212) UnhandledPromiseRejectionWarning: Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27) (node:6212) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:6212) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the
@twilio
@twilio 5 жыл бұрын
You’ll need to add error handling either with a try-catch or with a catch clause on the promise. This was left out for brevity. If you need more details, check here: javascript.info/promise-error-handling
@gideonboadu7402
@gideonboadu7402 5 жыл бұрын
Hi great video, I used this code to insert data in my google sheet. Is there documentation on how to loop data in the google sheets?
@twilio
@twilio 5 жыл бұрын
I'm not sure what you mean by loop data. Can you elaborate?
@LuRybz
@LuRybz 5 жыл бұрын
what is the syntax for AND operator in a query?
@hywell_
@hywell_ 5 жыл бұрын
I'm trying to use my bot to pull a url from a google spreadsheet and send it in a discord channel, but this url is created through the ImportXML function, and the bot is reading the url as "Loading..." instead. I can see the url perfectly fine on my screen, but apparently the bot can't. Is there any way to solve this problem?
@darkmift
@darkmift 5 жыл бұрын
Thats pretty cool, Can this package be used to create a cell with a function? Like =sum() etc...
@metalllus
@metalllus 5 жыл бұрын
Is it possible change cell formatting? say set font to bold or cell background color...
@twilio
@twilio 5 жыл бұрын
Unfortunately, the library we used in this video just deals with the data access portion of this. The Google API does support the changes you want to make but you'll have to use the slightly less user-friendly Google SDK or direct API calls to do this (scroll down and there's a JS sample): developers.google.com/sheets/api/guides/conditional-format
@metalllus
@metalllus 5 жыл бұрын
@@twilio I was afraid you would say that..
@twilio
@twilio 5 жыл бұрын
I was afraid I was going to say that too. I used the Google SDK for our PHP video since there wasn’t an active community library there. Not my favorite.
@ColeEastman-n9s
@ColeEastman-n9s 11 ай бұрын
Anyone know how to correct this error "TypeError: GoogleSpreadsheet is not a constructor" I have done the exact steps as he has in the video and I run node spreadsheet.js and get this error
@erolcoke1043
@erolcoke1043 3 жыл бұрын
Hello, I had an error spreadsheets.js:200 throw new Error("Spreadsheet key not provided."); but i have client_secret.json file and i defined it. Please help me
@MrHD71
@MrHD71 5 жыл бұрын
is it possible to have multiple query parameters?
@twilio
@twilio 5 жыл бұрын
Yep, you can use the query format documented here - developers.google.com/sheets/api/v3/data#send_a_structured_query_for_rows
@nurdauletdarbayev5033
@nurdauletdarbayev5033 5 жыл бұрын
Hi, i have a problem with spreadsheet.js, when i ran it from console. terminal provides error
@nurdauletdarbayev5033
@nurdauletdarbayev5033 5 жыл бұрын
error:(node:4299) UnhandledPromiseRejectionWarning: TypeError: GoogleSpreadsheet is not a constructor at accessSpreadsheet (/home/noserzhauyn/Desktop/telegram-bot/spreadsheet.js:7:17) at Object. (/home/noserzhauyn/Desktop/telegram-bot/spreadsheet.js:17:1) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11 (node:4299) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:4299) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@twilio
@twilio 5 жыл бұрын
I would need to see your code to know the problem, send me an email at brent@twilio.com.
@arunashivaprakash3460
@arunashivaprakash3460 5 жыл бұрын
@@nurdauletdarbayev5033 encountered the same issue
@Divyaa_
@Divyaa_ 5 жыл бұрын
Thank You For Sharing the video but can I apply the same code on Google Documents also(including Google Doc API)??
@usymmij
@usymmij 5 жыл бұрын
no
@MadhavSridhar
@MadhavSridhar 5 жыл бұрын
Hey, amazing video! For querying rows, I'm not able to pass anything with spaces in it - how do I make it work?
@twilio
@twilio 5 жыл бұрын
Try %20 instead of space.
@MadhavSridhar
@MadhavSridhar 5 жыл бұрын
@@twilio Tried that already, didn't work :( Instead I just read the entire dataset and then did the querying locally :P
@mohamed_v1
@mohamed_v1 5 жыл бұрын
can i use that on angular ??
@supernova6553
@supernova6553 5 жыл бұрын
how do you make the vsc's cursor transition smoothly?
@twilio
@twilio 5 жыл бұрын
There’s a setting (something starting with editor.smoothCursor) that makes this happen.
@withneyguilherme6390
@withneyguilherme6390 4 жыл бұрын
How to set spreadsheet as public link?
@ArtloopTeam
@ArtloopTeam 5 жыл бұрын
Hello, please help me to find way out(( how can i return the value(or array of values) with this functions so i can do something with it in my programm, cos it only returns Promisies(
@rahulkuchhadia8329
@rahulkuchhadia8329 4 жыл бұрын
First Thank You very much for this video. I have one doubt -> how can I add multiple queries to it?
@TriviaMania_
@TriviaMania_ 4 жыл бұрын
Hi. i got "Cannot set property 'jwtClient' of undefined" on the " await promisify(doc.useServiceAccountAuth)(creds);" line. Please help
@codeangler
@codeangler 4 жыл бұрын
Checkout Stackoverflow discussion stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google
@KanagawaMarcos
@KanagawaMarcos 5 жыл бұрын
TypeError: Cannot set property 'jwtClient' of undefined
@KnewLight
@KnewLight 5 жыл бұрын
Succinct, 👌🏾 [ viewer subscribed 😎 ]
@twilio
@twilio 5 жыл бұрын
Thanks for watching and for the sub!
@baynados
@baynados 5 жыл бұрын
It doesn't work for me. I get this messag, Error: Spreadsheet key not provided. And I followed the instructions exactly. :-(
@Josh-ho1pe
@Josh-ho1pe 4 жыл бұрын
when i run the code, all i get is "GoogleSpreadsheet is not a constructor." anyone know what I did wrong?
@Josh-ho1pe
@Josh-ho1pe 4 жыл бұрын
btw this is my code: const GoogleSpreadsheet = require('google-spreadsheet'); const { promisify } = require('util'); const creds = require('./client_secret.json') async function accessSpreadsheet() { const doc = new GoogleSpreadsheet('1dCAliKaJfNhUpzxU7QMf17XGTNJ1vLk2QPFNXxt91a0'); await promisify(doc.useServiceAccountAuth)(creds); const info = await promisify(doc.getInfo)(); const sheet = info.worksheets[0]; console.log(sheet.title); } accessSpreadsheet();
@Josh-ho1pe
@Josh-ho1pe 4 жыл бұрын
UPDATE: got it to work from this thread: stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google very cool
@twilio
@twilio 4 жыл бұрын
Yes I believe that’s also mentioned in the comments here. I should probably add it to the description.
@hashtag6666
@hashtag6666 4 жыл бұрын
@@Josh-ho1pe i follow your steps, but my code still not working
@hashtag6666
@hashtag6666 4 жыл бұрын
@@Josh-ho1pe it show some error like this [Running] node "c:\Users\z0983\0416正在進行\google-sheets-node\spreadsheet.js" internal/modules/cjs/loader.js:984 throw err; ^ Error: Cannot find module 'google-spreadsheet' Require stack: - c:\Users\z0983\0416正在進行\google-sheets-node\spreadsheet.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15) at Function.Module._load (internal/modules/cjs/loader.js:863:27) at Module.require (internal/modules/cjs/loader.js:1043:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (c:\Users\z0983\0416正在��行\google-sheets-node\spreadsheet.js:16:31) at Module._compile (internal/modules/cjs/loader.js:1157:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10) at Module.load (internal/modules/cjs/loader.js:1001:32) at Function.Module._load (internal/modules/cjs/loader.js:900:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'c:\\Users\\z0983\\0416正在進行\\google-sheets-node\\spreadsheet.js' ] } [Done] exited with code=1 in 0.144 seconds
@karapapaxatzidimitrakopoulos
@karapapaxatzidimitrakopoulos 3 жыл бұрын
i am in computer enginnering as well and i can relate for the need to distinguish it between computer science
@willinton06
@willinton06 5 жыл бұрын
I would prefer using C# or Java for something like this, specially C#, but I see why you would prefer not to
@twilio
@twilio 5 жыл бұрын
We have videos on this topic in those languages on this channel as well 😀
@willinton06
@willinton06 5 жыл бұрын
Twilio I’m definitely subscribing if that’s true
@twilio
@twilio 5 жыл бұрын
Google Sheets and .NET Core with C# kzbin.info/www/bejne/l5e3moGLa6qid5o
@twilio
@twilio 5 жыл бұрын
Google Sheets and Java kzbin.info/www/bejne/bqqto4Shbribhsk
@JasonLayton
@JasonLayton 3 жыл бұрын
I'm actually watching this video so that I can use Twilio. It just so happens Twilio produced the video :)
@ignatiusmaziofa2393
@ignatiusmaziofa2393 4 жыл бұрын
For me the filter is not working.
@vietdao5900
@vietdao5900 4 жыл бұрын
Yes, me too =((((( have you found out any solutions to this? =((((((
@luisforni86
@luisforni86 3 жыл бұрын
when you write "touch" it gives me an error
@twilio
@twilio 3 жыл бұрын
I’m guessing you’re on Windows? All touch does is create the file. Depending on your code editor and how you usually work on things, it might be easier to just create that in your editor 😀
@Robin-fn3tw
@Robin-fn3tw 4 жыл бұрын
Got anything for a google docs? I want to use a google doc file as an input in my code. Great tutorial btw
@paulkeeaust
@paulkeeaust 4 жыл бұрын
npm install google-spreadsheet@2.0.6 - that should fix it
@paulkeeaust
@paulkeeaust 4 жыл бұрын
sorry - wrong comment - meant to answer someone else's problem
@bhavinvarma9074
@bhavinvarma9074 4 жыл бұрын
UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'jwtClient' of undefined
@codeangler
@codeangler 4 жыл бұрын
Checkout Stackoverflow discussion stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google
@yuxinkang5962
@yuxinkang5962 4 жыл бұрын
@@codeangler it saved my life thank you thank you
@0xssff
@0xssff 4 жыл бұрын
cool Idea, I've been looking for a database solution for sometime now..
@hemidemisemipresent
@hemidemisemipresent 5 жыл бұрын
great guide! it worked for me a couple of times however, when i run: const GoogleSpreadsheet = require('google-spreadsheet') const { promisify } = require('util') const creds = require('../secret.json') async function access() { const doc = new GoogleSpreadsheet('1Ra9PoBxbAKFa3V34yl492H86UnOXzfgo_72ya77q3sA') await promisify(doc.useServiceAccountAuth)(creds) const info = await promisify(doc.getInfo) const sheet = info.worksheets[0] console.log(sheet.title) } access() i get this error: (node:3956) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined at access (C:\pathto.js:8:31) at process._tickCallback (internal/process/next_tick.js:68:7) (node:3956) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:3956) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. why is info.worksheets undefined when i console.log() it? the id is correct
@koriv6329
@koriv6329 4 жыл бұрын
I'm getting the same issue. I know this question is a while back, but have you found any solution?
@hemidemisemipresent
@hemidemisemipresent 4 жыл бұрын
@@koriv6329 I haven't found a solution in the v2 api shown in this video, but the new v3 Google-spreadsheet api fixes this
@hemidemisemipresent
@hemidemisemipresent 4 жыл бұрын
Unfortunately a lot of previous syntax has to change from v2 to v3
@jerometamayosa2472
@jerometamayosa2472 5 жыл бұрын
Thanks for the tutorial. Not sure why I'm getting row count of 1000, and col count of 26. Any idea what I'm doing wrong? LOL Thanks again!
Control Google Sheets with Node.js / JavaScript (v4 API)
25:51
James Grimshaw
Рет қаралды 126 М.
Google Sheets and .NET Core with C#
11:14
Twilio
Рет қаралды 79 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
7 Amazing Developer Tools that you're not using yet
6:27
Fireship
Рет қаралды 1,9 МЛН
Faster apps with JSON.parse (Chrome Dev Summit 2019)
6:40
Chrome for Developers
Рет қаралды 312 М.
A Guide to Web Scraping with Node.js
9:54
Fireship
Рет қаралды 387 М.
Realtime Chat With Users & Rooms - Socket.io, Node & Express
58:45
Traversy Media
Рет қаралды 892 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Google Sheets API - JavaScript NodeJS Tutorial
45:29
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 115 М.
Google Sheets and Python
6:31
Twilio
Рет қаралды 1,2 МЛН
Best of CES 2025
14:50
The Verge
Рет қаралды 632 М.
Build A Node.js API Authentication With JWT Tutorial
1:15:41
developedbyed
Рет қаралды 736 М.
Build Real Time Face Detection With JavaScript
12:41
Web Dev Simplified
Рет қаралды 1,4 МЛН
пранк🤣😂😂
0:51
Numdexx1
Рет қаралды 1,2 МЛН
DID YOU NOTICE ANY LAPSES IN THE VIDEO or NOT? / MARGO_FLURY
0:34
MARGO FLURY | Маргарита Дьяченкова
Рет қаралды 12 МЛН
НИКОГДА не иди на сделку с сестрой!
0:11
Даша Боровик
Рет қаралды 729 М.
Проверил, как вам?
1:01
Коннор
Рет қаралды 964 М.
Monster My Best Friend 🥹❤️👻 #shorts Tiktok
1:01
BETER BÖCÜK
Рет қаралды 29 МЛН