Google Sheets and JavaScript with Node.js

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 249

  • @twilio
    @twilio  4 роки тому +4

    🔥 WATCH NEXT: Build an Animal Crossing price lookup bot with Google Sheets and WhatsApp ua-cam.com/video/eqtQ76X_owQ/v-deo.html

    • @nexoska
      @nexoska 4 роки тому +1

      Hey!, i have a question, how can you throw an error message, if the query fails?

  • @RendallRen
    @RendallRen 5 років тому +196

    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 років тому +1

      Thanks for watching Rendall and for the kind words!

    • @twilio
      @twilio  5 років тому +1

      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.

  • @lskaling
    @lskaling 2 роки тому +7

    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.

  • @AhmadAwais
    @AhmadAwais 5 років тому +46

    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 роки тому +1

    dang this man gets straight to the point and shows all of what you probably would want to do, very epic.

  • @elmercin
    @elmercin 4 роки тому +14

    Came here looking for copper and found gold, great tutorial!

    • @twilio
      @twilio  4 роки тому +1

      Happy to help! Let us know if there’s more gold we can help you mine.

  • @mo3k
    @mo3k 4 роки тому +1

    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!

  • @dimkir100
    @dimkir100 5 років тому +9

    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 років тому +2

      Great suggestion. We sometimes leave out error checks for brevity in the videos but I’d definitely suggest adding that one!

  • @Sunsets5000
    @Sunsets5000 3 роки тому +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!

  • @twilio
    @twilio  5 років тому +26

    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 років тому +1

      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 4 роки тому

      but is safe to use?

  • @weyauh4338
    @weyauh4338 5 років тому +7

    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 років тому +1

      I’m glad I could help! Let me know what you build 😀

    • @weyauh4338
      @weyauh4338 5 років тому +2

      @@twilio this channel is not run by a single person, right? The production and video quality is impeccable!

    • @PhilNash
      @PhilNash 5 років тому +4

      @@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 3 роки тому

      How I can add multiple queries? any idea?

  • @AdeelImranr
    @AdeelImranr 5 років тому +7

    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!

  • @brunopuccio9535
    @brunopuccio9535 5 років тому +2

    this is the best programming tutorial i have ever seen, dude you are awesome

  • @sr_aman
    @sr_aman 4 роки тому

    Gold standard for tutorials.

  • @adityak1231
    @adityak1231 3 роки тому +6

    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 3 роки тому

      same error how do we fix this?

    • @Jimmy-rh5lk
      @Jimmy-rh5lk 3 роки тому

      same

    • @Jimmy-rh5lk
      @Jimmy-rh5lk 3 роки тому

      npm install google-spreadsheet@2.0.6

    • @Jimmy-rh5lk
      @Jimmy-rh5lk 3 роки тому

      how to fix ^^

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

      to import google-spreadsheets you need
      const { GoogleSpreadsheet } = require('google-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.

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

    Why did you select Google Drive API and not Google Sheets API at 0:33?

  • @KostasOreopoulos
    @KostasOreopoulos 4 роки тому +1

    Really great video. Compact and informative. Easy to QuickStart exploring the api

    • @twilio
      @twilio  4 роки тому

      Thanks for the kind words and thanks for watching!

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

    this video just saved my career
    thank you

  • @LuisRuizHalo
    @LuisRuizHalo 4 роки тому

    Love this format of vids. Simple, quick and dynamic. You just got another sub.

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

    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  4 роки тому +3

      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 4 роки тому

      @@twilio Nice one! keep it up

  • @tahsinature
    @tahsinature 4 роки тому +3

    expecting more vids like this

    • @twilio
      @twilio  4 роки тому

      Thanks for watching!

  • @zekewolf6877
    @zekewolf6877 5 років тому +1

    This tutorial is outstanding! Keep up the great work!

    • @twilio
      @twilio  5 років тому +1

      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

  •  4 роки тому +1

    Superb! Awesome video. Thanks a lot for sharing! :)

    • @twilio
      @twilio  4 роки тому

      You’re welcome, thanks for watching!

  • @simplyfabian
    @simplyfabian 5 років тому +1

    Really good video on a nice topic, definitely bookmarked for later use when I am planning new NodeJs projects ^_^
    Have a great day!

  • @jorgekunrath1016
    @jorgekunrath1016 4 роки тому +9

    wow this looks awesome, wondering if I could use a spreadsheet as a database for a ecommerce

    • @twilio
      @twilio  4 роки тому +7

      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.

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

    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?

  • @developerspoot
    @developerspoot 4 роки тому +5

    Could you make a new video on the updated version of spreadsheet?

  • @sentry404.
    @sentry404. 5 років тому +2

    Cheers for your time my man!

    • @twilio
      @twilio  5 років тому

      Thanks for watching Doug!

  • @milktea3192
    @milktea3192 4 роки тому +6

    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 роки тому +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 роки тому +3

      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 роки тому +1

      @@mikalmorello7768 Ok thank you so much! I'll try it later

    • @zachwhite8054
      @zachwhite8054 4 роки тому +1

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

  • @usymmij
    @usymmij 5 років тому

    this is a better tutorial than google has

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

    Awesome! Is there any way to do this with user selected spreadsheets without the service account?

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

    i am in computer enginnering as well and i can relate for the need to distinguish it between computer science

  • @techWithSaifullah
    @techWithSaifullah 4 роки тому +1

    *Excellent Video*

    • @twilio
      @twilio  4 роки тому

      Thanks for watching!

  • @naveenk2k
    @naveenk2k 5 років тому +1

    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.

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

    Thanks for the old version of API(v3), do you think make new video about new version of spreadsheet API (v4)

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

    Thanks a lot. This was really helpful.

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

      Thanks for watching and very glad we could help!

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

    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?

  • @ramzirabahhazila8629
    @ramzirabahhazila8629 4 роки тому +1

    The greatest tutorial thank you so much

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

    Why are you working with google drive API when the sheet API is the thing you need?

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

    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?

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

    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  4 роки тому

      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

  • @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 ?

  • @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?

  • @mounaboudjelida4932
    @mounaboudjelida4932 4 роки тому +1

    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?

  • @brunopuccio9535
    @brunopuccio9535 5 років тому +2

    what if there was an image uploaded in the cell? how would you do to get the url

    • @twilio
      @twilio  5 років тому +3

      Been trying to figure this out for you. I keep getting back an empty result for that field though.

  • @0xssff
    @0xssff 4 роки тому

    cool Idea, I've been looking for a database solution for sometime now..

  • @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?

  • @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_ 3 роки тому

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

  • @ibrarramzanmalik7663
    @ibrarramzanmalik7663 4 роки тому

    It helped me! Thank you! so much!!!

  • @wizlee-dev
    @wizlee-dev 4 роки тому +1

    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  4 роки тому +1

      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 4 роки тому +1

      @@twilio that makes sense. Thanks!

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

  • @user-ed4kf9yf4l
    @user-ed4kf9yf4l 7 місяців тому

    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

  • @willinton06
    @willinton06 4 роки тому +4

    I would prefer using C# or Java for something like this, specially C#, but I see why you would prefer not to

    • @twilio
      @twilio  4 роки тому +1

      We have videos on this topic in those languages on this channel as well 😀

    • @willinton06
      @willinton06 4 роки тому +1

      Twilio I’m definitely subscribing if that’s true

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

      Google Sheets and .NET Core with C# ua-cam.com/video/afTiNU6EoA8/v-deo.html

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

      Google Sheets and Java ua-cam.com/video/8yJrQk9ShPg/v-deo.html

  • @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¿

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

  • @bumblebytrox6783
    @bumblebytrox6783 4 роки тому +1

    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 4 роки тому

      did you solve it?

    • @bumblebytrox6783
      @bumblebytrox6783 4 роки тому

      @@KanagawaMarcos nope ;(

    • @philippschweizer6556
      @philippschweizer6556 4 роки тому +1

      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 4 роки тому

      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 4 роки тому +2

      Marcos C. Santos I would love that.

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

    Something isn’t working for me, the console just says “GoogleSpreadsheet is not a constructor” what have I done wrong?

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

      I managed to get it fixed, if you have a similar problem just google the error message and you’ll quickly find a solution

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

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

    First Thank You very much for this video.
    I have one doubt -> how can I add multiple queries to it?

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

    Could I use this same approach to display data from a spreadsheet dynamically on a site?

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

    Hi thank you for the video ! I'm wonderign how to get a column name that has space in it ?

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

  • @RaviAnandinfo
    @RaviAnandinfo 5 років тому +1

    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 років тому +1

      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 років тому +1

      @@twilio thanks for quick response. :)

    • @twilio
      @twilio  5 років тому

      Sure thing! Let me know if it works for you.

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

    BTW do we need to buy the subscription of google api or is it free?

  • @techrelayhub
    @techrelayhub 5 років тому +1

    man you are good

    • @twilio
      @twilio  5 років тому

      Thanks for watching!

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

    I'm actually watching this video so that I can use Twilio. It just so happens Twilio produced the video :)

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

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

    All these Functions no longer work. The Library you used got updated. Now when I try it gives Errors.

  • @metalllus
    @metalllus 5 років тому +1

    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.

  • @darkmift
    @darkmift 4 роки тому

    Thats pretty cool,
    Can this package be used to create a cell with a function?
    Like =sum() etc...

  • @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(

  • @hemidemisemipresent
    @hemidemisemipresent 4 роки тому +1

    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

  • @NilsVanhauwaert
    @NilsVanhauwaert 4 роки тому

    Hi, thanks for this video. Although I think something has changed in Google-Spreadsheet. I'm using the exact same code like you but getting an error back each time.
    This is the code:
    const { GoogleSpreadsheet } = require('google-spreadsheet');
    const { promisify } = require('util');
    const creds = require('./blablabla.json');
    async function accessSpreadsheet() {
    const doc = new GoogleSpreadsheet('xxxxxxxxxxxxxxxxxxxxxxx')
    await promisify(doc.useServiceAccountAuth)(creds)
    const info = await promisify(doc.getInfo)();
    const sheet = info.worksheets[0];
    console.log(`Title: ${sheet.title}, Rows: ${sheet.rowCount}`)
    }
    accessSpreadsheet();
    The error I get back over and over again is:
    (node:5132) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'jwtClient' of undefined
    at useServiceAccountAuth (C:\Users\Nils\Desktop
    ode
    ode_modules\google-spreadsheet\lib\GoogleSpreadsheet.js:53:20)
    at internal/util.js:278:30
    at new Promise ()
    at useServiceAccountAuth (internal/util.js:277:12)
    at accessSpreadsheet (C:\Users\Nils\Desktop
    ode\cryptopremium\sheet.js:8:47)
    at Object. (C:\Users\Nils\Desktop
    ode\cryptopremium\sheet.js:14:1)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    (node:5132) 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:5132) [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.
    Anyone has a solution?

    • @twilio
      @twilio  4 роки тому

      Something is not right with your credentials. You can try putting a catch on the promises that fail to see if it will give you more info.

    • @codeangler
      @codeangler 4 роки тому

      Checkout Stackoverflow discussion
      stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google

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

    what does the double brackets in line 8 mean??

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

    Dillon is King and Jan is Queen Johanna

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

    Sorry, I am a newbie. What is the function of doing this?

    • @motsgar
      @motsgar 4 роки тому

      Explain more, i don't understand your problem

    • @twilio
      @twilio  4 роки тому

      This allows you to access, store, and modify data in Google Sheets spreadsheets.

    • @ezteco4899
      @ezteco4899 4 роки тому

      @@twilio so it can be like a database?

  • @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?

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

    What if you want to pull/push data across multiple tabs? How would you specify the tab?

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

      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.

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

    You enabled the wrong api I was stuck on this error for a long time 0:32 :(

  • @KanagawaMarcos
    @KanagawaMarcos 4 роки тому

    TypeError: Cannot set property 'jwtClient' of undefined

  • @maratimus
    @maratimus 5 років тому

    thank you so much

  • @LuRybz
    @LuRybz 4 роки тому

    what is the syntax for AND operator in a query?

  • @googleplexer
    @googleplexer 4 роки тому

    Awesome !!!

  • @jerryjeremy4038
    @jerryjeremy4038 4 роки тому +1

    I dont googlesheet or node but i liked it.

    • @twilio
      @twilio  4 роки тому

      Thanks for watching!

  • @paulopacitti
    @paulopacitti 5 років тому +2

    What's the name of this theme on your text editor?

    • @twilio
      @twilio  5 років тому +1

      It's called Quiet Light. I believe it was built in to VS Code.

  • @withneyguilherme6390
    @withneyguilherme6390 4 роки тому

    How to set spreadsheet as public link?

  • @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 роки тому +1

      Checkout Stackoverflow discussion
      stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google

  • @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?

  • @luanderarruda6873
    @luanderarruda6873 5 років тому

    Perfeito! Muito obrigado

  • @Divyaa_
    @Divyaa_ 5 років тому

    Thank You For Sharing the video but can I apply the same code on Google Documents also(including Google Doc API)??

  • @ytmrdk
    @ytmrdk 4 роки тому

    Nice!

  • @KnewLight
    @KnewLight 4 роки тому +1

    Succinct, 👌🏾
    [ viewer subscribed 😎 ]

    • @twilio
      @twilio  4 роки тому

      Thanks for watching and for the sub!

  • @bhavinvarma9074
    @bhavinvarma9074 4 роки тому

    UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'jwtClient' of undefined

    • @codeangler
      @codeangler 4 роки тому +1

      Checkout Stackoverflow discussion
      stackoverflow.com/questions/60349027/cannot-set-property-jwtclient-of-undefined-trying-to-use-node-js-with-google

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

      @@codeangler it saved my life thank you thank you

  • @MadhavSridhar
    @MadhavSridhar 4 роки тому

    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  4 роки тому +2

      Try %20 instead of space.

    • @MadhavSridhar
      @MadhavSridhar 4 роки тому

      @@twilio Tried that already, didn't work :( Instead I just read the entire dataset and then did the querying locally :P

  • @i_am_ur_manager7673
    @i_am_ur_manager7673 4 роки тому

    Now WE can do a reverse shell tcp with node

  • @JarodWilliam
    @JarodWilliam 4 роки тому

    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  4 роки тому

      I don’t think it ever says the account exists. It should still work.

    • @JarodWilliam
      @JarodWilliam 4 роки тому +1

      @@twilio Still doesn't work, but I found another way.

  • @Josh-ho1pe
    @Josh-ho1pe 4 роки тому +1

    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 роки тому +3

      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

  • @ignatiusmaziofa2393
    @ignatiusmaziofa2393 4 роки тому

    For me the filter is not working.

    • @vietdao5900
      @vietdao5900 4 роки тому

      Yes, me too =((((( have you found out any solutions to this? =((((((