How to Debug Google Apps Script
HTML-код
- Опубликовано: 16 сен 2024
- How to Debug Google Apps Script when your code is failing? Learn how find the error in your code in this tutorial video.
#GoogleAppsScript #HowToDebugGoogleAppsScript #GoogleAppsScriptTutorial
-----
saperis - Helping you become a Google Workspace!
If you're interested in leveling up your Google Apps Script skill have a look at my online cours: https//courses.saperis.io
Sign up to our RUclips channel for more Google Workspace, Gmail, Google Docs, Google Drive, etc. videos: / @saperis
saperis website: saperis.io/
saperis Linkedin: / saperis
saperis Twitter: / saperis_io
Tried to figure out App Scripts debugging off and on for weeks - in 15 minutes you made it obvious. Thanks
Happy to hear that Peter! Google has announced a new Script Editor. From the screenshots I've seen it should give even more debugging options.
I think the term "debugging" is a historical term from when computers were the size of a room, and programs were punch cards that were physically fed into the computer. There was a time when something didn't work and it turned out there was an insect inside it somewhere? Hence debugging :)
Yes, that's the same story I heard. From that time on trying to find the error was called "debugging".
Bugs not only interrupted punched cards, they also got burned on hot components and made those components warm up even worse.
Also - and thats a verified story - they would get into the old huge hard-drives ( the ones that looked like washing machines) and get smeared on the fast rotating disks 😬
I began coding in 1964, the dawn of the computer era. My first computer was made with vacuum tubes. The generation of computers before that were made with relay mechanical switches. In the computer room you could hear the clickity-click of all the relays switching on or off. One day the computer stopped giving the correct answer. It was determined that a moth got caught in one of the relays. Since that time if anything didn't work you had to see if you had another bug in the system. True story.
And "bug" it has been called ever since. 🐞
I'm interested in learning more about web apps using apps scripts. I really like your videos
Hi Julian. Thank you very much! I'll keep on creating Google Apps Script videos. - Chanel
I dont know if things simply changed in 2024, but I dont get all the windows at the bottom for the debugger. All I get is a panel at the right-hand side that says "variables" and it shows my variables with an arrow to expand, but expanding them only shows me the functions I can use on them. Expanding such a function will NOT show me any useful information. They all show length 0, name "", arguments null and caller null. For every single variable and every single function I have checked. You'd think that it would show the value in getValue, but no.
I'm trying to script for the first time, all good tutorials are from years ago and I'm at my wit's end because my debugger doesn't look anywhere close to what the videos show 😢
I know a bit of Java so I'm figuring some simple things out at I go (and for those things the debugger also doesn't show anything useful), but just a tad more advanced is already not working, likely because I just dont know the correct functions/methods and perhaps syntax, I mean its a different language. But the debugger should help me figure out what DOES go right and where it goes wrong, so that I can properly look that up.... except it doesnt.
Would be great if, in debuging mode, we could point to a variable in the screen and it shows its content instantly, like in Visual Basic IDE. Or we have a screen area where we can fill the variable name and press enter to reveal its content, like occurs in ABAP IDE.
Yes, that would be nice.
Your explanations are excellent!
Glad you like them! I thinks it's important that we as educators don't only show but also explain. 😀
Zooming of code recording may make this video amazing
Thanks for the hint.
useful - helpful ....thank you so much
Glad it was helpful! 😀
I am using Google Sheets and am trying to debug my script to add 10 lines at a time in a growing activity table. The scrip that is made available to me doesn not have the view option shown in your You Tube video.
This video was made with the old script editor. It has since been updated.
If you want to learn how to debug or check your code, have a look at this video: ruclips.net/video/L4V15ZxIjBQ/видео.html
good morning ... my most appreciate teacher ... 😊 it is hard to find in the web .... but how can i debug functions ... with input parameters, variables that come automated ?
Check out this video: ruclips.net/video/L4V15ZxIjBQ/видео.html
@@saperis hy madame ... my Chanel No. 1. Meanwhile i had a thousands of problems to solve. One of my biggest one was ... writing a file ( or copy a file via appscript ) lasts about 7 seconds ( till the file is really written on the servers harddisk ), i had to read again this written file ( and had to stop the program for 7 seconds ). awesome .. in my 40 years of programming experience i never had problems like these. and so on and so on ...
Another one is, that it takes too much time to write rows to a sheet. i cannot use the appsheet database ( main reason is, that i cannot correspond with appscript with the appsheet database ... ) 1 million tears i cried ... maybe there were 2 millions 😢 )
And you ... yes you my best teacher ... you helped me in so many ways ... without you ( it is not to imagine ) i would stay at the beginning of my appsheet and appscript world. Thanks a thousand times ... 🌺❤️🌺 keep cold and warm ( as it is the best for you at any time ) .. and last but not least ... please forgive my jungle english 😎
Thanks a lot. i've been working on google apps script but i could not find the way to debug.
Glad to help Jorge. By the way you might want to check out my Google Apps Script course I'll be soon launching: courses.saperis.io/
what's about bug form conversion vba to apps scripts ?
Good question...haven't tried the conversion tool out yet.
Acutally though I came across your video because I'm having trouble debugging. For some reason I can't expand the plus signs at the bottom where the locals and globals window is. I can expand the local one, but I can't expand anything under that. Have you come across this before? Thanks! I love your methodica clear explanations.
I've had this same behavior like you mentioned two days ago while I was debugging a script. It's either a bug or they've changed the functionality of the debugging mode. Here someone reported the same problem on Stackoverflow: stackoverflow.com/questions/63082546/apps-script-not-expand-global-variables-in-debug-mode
Greetings, Chanel
@@saperis Ah ha!! Thank you! So it is not something I'm doing wrong.
how would you debug if your function takes an argument? You cannot simply "run" since it won't know what value(s) are inputtet, right? 🤔
Even if your function uses an argument you can debug. You could also log the argument to the console before you pass it into the function.
Can we create a website with google apps scrpt linked with google sheets ..
. The student can enter his personal number, which is in the first column in advance, and to match the number, the rest of the column values appear on the web page or site ..
.... I would like to do it with google apps scrpt and google sheets
Yes, you can publish websites with Apps Scripts of publish a Google Sheets file as a website.
Since we have no experience with such tasks please refer to the official Google Apps Script documentation: developers.google.com/apps-script/reference
If anyone knows how to update an existing form, I would appreciate guidance
Have a look at the documentation for Forms to see what's possible: developers.google.com/apps-script/reference/forms
debuging
I made a second video where I show how to debug with the new Script Editor (IDE): ruclips.net/video/L4V15ZxIjBQ/видео.html