Google Apps Script Triggers Explained 👈🏽

  Рет қаралды 30,848

saperis

saperis

Күн бұрын

In this video we'll cover Google Apps Script triggers: the types of triggers you can use, the restrictions and so on.
Want to check what the quota limits are for the Apps Script triggers? Check the official documentation: developers.google.com/apps-sc...
0:00 What are triggers?
0:56 Simple triggers explained
6:49 Installable triggers explained
9:42 How to add installable triggers
11:33 Google Workspace application triggers
12:37 Programmatic managing of triggers
13:18 Trigger errors
If you're interested in leveling up your Google Apps Script skill have a look at my online course: https//courses.saperis.io
#GoogleAppsScriptTriggers #GoogleAppsScript #AppsScript #GoogleWorkspace #GoogleSheets #saperis #ChanelGreco
-----
saperis - Helping you become a Google Workspace Pro!
Sign up to our KZbin channel for more Google Workspace, Gmail, Google Apps Script, Google Drive, etc. videos: / saperis
saperis website: saperis.io/
saperis Linkedin: / saperis
saperis Twitter: / saperis_io

Пікірлер: 92
@TheDervMan
@TheDervMan 3 жыл бұрын
Oh wow, I was completely unaware there are so many types of triggers! Thanks Chanel
@saperis
@saperis 3 жыл бұрын
Always happy to share my knowledge with our viewers. Thank you for the feedback. 😀
@fionawylie7221
@fionawylie7221 2 жыл бұрын
I'm learning how to app script from you, I'm a total beginner and your videos are essential watching for me. Thanks so much.
@saperis
@saperis 2 жыл бұрын
Great to hear that! I know learning a new skill can be a bit difficult at times, but please keep at it. 👍
@juancanete9118
@juancanete9118 Жыл бұрын
Loved your hair. And yes, I did learn plenty of useful things I didn't know before. Thank you!
@saperis
@saperis Жыл бұрын
Happy you liked the video and the hair. 😀
@jameskosterman3775
@jameskosterman3775 Жыл бұрын
Thanks - that was very helpful. I've written code for data analysis for several years, but I'm just starting to use scripts and macro's in Google, and getting my triggers to work as expected has been a problem. This answers some of my questions
@saperis
@saperis Жыл бұрын
Happy to hear that 😀
@AndrewPollock
@AndrewPollock 2 жыл бұрын
Impressively slick video, thanks!
@saperis
@saperis 2 жыл бұрын
Glad you enjoyed it! 😀
@oktaypocan
@oktaypocan Жыл бұрын
Thank you! This helped a lot.
@saperis
@saperis Жыл бұрын
Glad it helped! 😀
@miguelwillbanks3344
@miguelwillbanks3344 Жыл бұрын
Informative, thanks!
@saperis
@saperis Жыл бұрын
Glad it was helpful!
@aVersCloudSolution
@aVersCloudSolution 2 жыл бұрын
Thank you so much!
@saperis
@saperis 2 жыл бұрын
You're welcome! 😀
@lesptitsoiseaux
@lesptitsoiseaux 2 жыл бұрын
Chanel, you scare me a little. But your videos are top of the line! Love them 😍
@saperis
@saperis 2 жыл бұрын
Sorry I look scary but happy you like the videos. 😉
@lesptitsoiseaux
@lesptitsoiseaux 2 жыл бұрын
@@saperis My French got in the way, that came out wrong. You look very smart and I'd hate to be in argument with you. Ok, that's more like it. Cheers from Vancouver :)
@saperis
@saperis 2 жыл бұрын
Ah, pas de problème! 😀
@lesptitsoiseaux
@lesptitsoiseaux 2 жыл бұрын
@@saperis video suggestion: working with strings in google scripts! For me, beginning, its really hit and miss if any given function will work. Just getting the id of sheet turns out a hassle (.match not recognized, etc). Cheers
@pyrsartur3675
@pyrsartur3675 3 жыл бұрын
Very helpful. Thank you.
@saperis
@saperis 3 жыл бұрын
You're welcome! 😀
@pyrsartur3675
@pyrsartur3675 3 жыл бұрын
@@saperis I am just beginning to look into Google’s new AppSheet. Can’t wait to see how I can use it to automate some of my workflow. Have you begun using it yet?
@saperis
@saperis 3 жыл бұрын
I checked it out a couple of months ago but I don't actually use it. I might start creating some videos on it in the future but I'm not sure about it yet.
@jessehahka
@jessehahka 2 жыл бұрын
That was great. Thanks. I’m making a Glide app. Would your Google Apps Script work with the Glide app platform? I was considering it as an option for a email response to users, authorizations, and anything else useful.
@saperis
@saperis 2 жыл бұрын
I've never tried out Glide apps. But it looks like other people are using it together with Google Apps Script: dev.to/harishkotra/apps-script-rest-apis-google-sheets-glide-apps-42h6
@ronaldvida6680
@ronaldvida6680 Жыл бұрын
Love your explanations! I am trying to use the openById method (in a bound script) to open one of my other spreadsheets, but keep getting a permission error. Discussion boards say that the way around the problem is to use a "trigger". What does this mean? (Note: I'm brand new to Google Apps Script -- this is my 2nd day!)
@saperis
@saperis Жыл бұрын
I'm guessing you don't have access to the file you are trying to open. I believe you would need at least viewing rights on that document. Check this video to find out what triggers are: kzbin.info/www/bejne/gXSaoXWgeZh6fdk
@nachomascort5770
@nachomascort5770 2 жыл бұрын
Hi Saperis, Great video but I have a question: I want to have a function that capture some data from the user that is using my Add-on in the onOpen() event. I've tried with the installable triggers but it's only working in my spreadsheet, not at an Add-on level (in the rest of user's spreadsheets). What i want is when a user opens their spreadsheet my custom function runs. Do you know what thing I'm doing wrong? Thanks!
@saperis
@saperis 2 жыл бұрын
If you are referring to a add-on the user installed I suggest you have a look at the official add-on documentation: developers.google.com/apps-script/add-ons/overview As I've never created an add-on myself I have no information that could be useful to your situation.
@atzgoblastbotzo
@atzgoblastbotzo 11 ай бұрын
interesting but the low pulsating hum that sounds like a ventilator is really distracting. I recommend you apply a low-pass filter on your sound file.
@saperis
@saperis 11 ай бұрын
Well, this video was made ages ago. Since then my video setup has changed. But thanks for the tip.
@atzgoblastbotzo
@atzgoblastbotzo 11 ай бұрын
@@saperis well the content is still relevant 🙂 And I meant a high-pass filter not a low-pass filter, sorry. The hum is loud on good headphones but would probably not be heard on lower quality equipment. Have a nice day !
@pengli3818
@pengli3818 Жыл бұрын
Thank you alot for this useful video, making my understanding structured. 👍 Just do you know how to get a summary of all Google Apps Script triggers in my account? I start to use triggers little by little with lots of test projects 😜 I hope one day I can find out all my deployed triggers in order to remove useless ones.
@saperis
@saperis Жыл бұрын
Check the Apps Script home screen and then the "My Triggers" section. Try this direct link: script.google.com/u/0/home/triggers
@pengli3818
@pengli3818 Жыл бұрын
@@saperis Ah great, I even didn't know there is a home page for Apps Script. So sweet of you, thank you Saperis again! Have a nice day 😃
@Mat-hi-as
@Mat-hi-as 2 жыл бұрын
Thanks for the video! Can you help me with code to let my script determine whether the trigger source from a particular run event was from CLOCK or from manual (e.g. pressing Debug or Run)? I thought it was getEventTrigger but it seems to return all the scheduled triggers for the script. I'm looking for a run-time check of how this instance was executed. Thanks for any tips!
@saperis
@saperis 2 жыл бұрын
The event object should give you the information you're looking for. You get that objet with simple and installable triggers. Have a look at the documentation: developers.google.com/apps-script/guides/triggers/events
@bridgemeldformulieren4581
@bridgemeldformulieren4581 2 жыл бұрын
Interesting Video! I have a time trigger (weekly fires) that activate a function that contains an installable trigger. In some google sheets the weekly trigger does not fire, in some it does. What could be the reason that it not fires?
@saperis
@saperis 2 жыл бұрын
No idea what might be causing this. Many people have issues with time-based triggers not working as expected. Found this thread on Stackoverflow that might be interesting: stackoverflow.com/questions/59175431/time-driven-triggers-not-working-properly
@bridgemeldformulieren4581
@bridgemeldformulieren4581 2 жыл бұрын
@@saperis Thanks for fast respons! In between I solved the problem! The files, where the triggers did not work, are corrupt. After replacing these files everything works fine. Many times is this the solution for time driven triggers...
@thatchermines8399
@thatchermines8399 Жыл бұрын
Nice video--Just FYI that the link you mention for learning more deeply about GoogleSheet automation doesn't seem to be working, and the link from your comments shows a course "Productivity for Creatives with Google Workspace" (same on domestika), but not one for automation.
@saperis
@saperis Жыл бұрын
Yes, the Apps Script course is no longer available. The only course currently available is the one on Domestika.
@OrkedZaquan
@OrkedZaquan Жыл бұрын
HI, I have a question, I create a code linking form, spreadsheet, and calendar using onFormSubmit() which it will map the leave request date on the calendar once the form is submitted. The code works just fine. But when I add some IF ELSE function for the drop-down in the form, it doesn't work. Which trigger I should use for this?
@saperis
@saperis Жыл бұрын
Do you expect the script to run because you manually add an IF/ELSE Sheets function? Or do you mean that after adding the IF/ELSE function to your Google Sheet, the onFormSubmit() trigger doesn't work anymore whenever someone submits the form?
@dakshbhatnagar
@dakshbhatnagar 4 ай бұрын
Great video, I want to set up a trigger to be run every 72 hours. Let’s say I create the trigger, now what should I do when setting up the trigger using that window??
@saperis
@saperis 4 ай бұрын
Nothing. It will run just as you set it. That's why it's time-based. It runs based on the time you have defined, without you having to do anything else.
@dakshbhatnagar
@dakshbhatnagar 4 ай бұрын
@@saperis thanks for your response. The issue here is google doesn’t allow for every 3rd day or 72 hours option so I was just wondering how would I go about it’s any help would be appreciated.
@saperis
@saperis 4 ай бұрын
In that case check out how you can add a trigger through a script: developers.google.com/apps-script/guides/triggers/installable#time-driven_triggers
@peterfrost250
@peterfrost250 3 жыл бұрын
Thanks for your video. I am new to script writing. I created a data sheet taking API data by the minute from several pages, but suddenly everything stops working / updating. Is it due to: "Triggers total runtime 90 min / day"? I am watching arbitrage data and would like it updated by the minute for about 20-30 data points. Any recs on managing this? I'm way outside of my wheelhouse, but enjoying this dive into it.
@saperis
@saperis 3 жыл бұрын
Hi Peter. I would, just like you, suppose you're reaching the quota limits and due to that the script stops executing after some iterations. There isn't really a workaround for that.
@peterfrost250
@peterfrost250 3 жыл бұрын
@@saperis Thanks so much for replying to my comment! I worried I failed in the script writing. I am really excited to learn these new things. Thank you! and I look forward to your future content.
@saperis
@saperis 3 жыл бұрын
Check out my online course on Google Apps Script: courses.saperis.io/
@confiabledelivery3756
@confiabledelivery3756 Жыл бұрын
So, here is the thing. I wish to place inside a cell the formula =now() and see the clock updating its seconds in real time, using the format "hh:mm:ss" from a fixed cell. It can be done in excel. I wonder if it can be done in Google Sheets, I thought that if I could trigger the show event every second I could have a clock effect, but such option is not at sight (seconds). Any suggestion?
@saperis
@saperis Жыл бұрын
There's a NOW() formula in Sheets too: support.google.com/docs/answer/3092981?hl=en#:~:text=NOW%20provides%20the%20current%20date,when%20it%20was%20first%20entered. This formula updates every time the spreadsheet is edited. In theory, you could set the the NOW() formula with an Apps Script function you write and use a time-based trigger to update it. But I think you might quickly hit a quota limit if you run the script every second. See this video to find out how to set a formula with Apps Script: kzbin.info/www/bejne/l4qqZmh3odWlfqc
@yllazora.7553
@yllazora.7553 4 ай бұрын
Hi! I have several onEdit triggers but when I duplicate the sheet, all of it are gone on Triggers and have to manually add all of it again on the duplicate sheet. Is there a way that those onEdit triggers won't be removed once I create a copy of the original sheet? Thank you.
@saperis
@saperis 4 ай бұрын
Maybe adding the onEdit trigger in the script instead of through the user interface, could help solve this issue: developers.google.com/apps-script/guides/triggers#onedite
@yllazora.7553
@yllazora.7553 4 ай бұрын
@@saperis Thank you. 😀
@bukaIapak
@bukaIapak 2 жыл бұрын
Let's say I build a google sheet add-on, can I use installable trigger to run in users who install my add-on?
@saperis
@saperis 2 жыл бұрын
According to the Apps Script documentation you can. Read the details here: developers.google.com/apps-script/add-ons/concepts/workspace-triggers#installable_triggers But I have never built an add-on myself yet so I can't speak from experience about this topic.
@shrutigoyal6374
@shrutigoyal6374 2 жыл бұрын
Hi Saperis Can you guide how can you stop trigger execution after 5 times?
@saperis
@saperis 2 жыл бұрын
You would probably have to build a script yourself that tracks how many times a script ran. There is no default way of running your script for X times.
@giovannimattioli7372
@giovannimattioli7372 Ай бұрын
hi sorry but when i go to the clock it didn't give me the botton ADD trigger, it give me file.json and file.gs, what i have to do????
@sylwuskak7065
@sylwuskak7065 2 жыл бұрын
Great video. However I still don't understand how to make an installable trigger with event source "From spreadsheet" when it is not a bound script. Any idea?
@saperis
@saperis 2 жыл бұрын
Check this section of the Google Apps Script documentation for an answer: developers.google.com/apps-script/guides/triggers/installable#application_triggers
@sylwuskak7065
@sylwuskak7065 2 жыл бұрын
@@saperis Thank you for your answer. Honestly, I think I've read all of the Google documentation so far. When I create a new project (not bounded) then there is no option "From spreadsheet" in "Select event source" select. When I changed the manifest file, this option appeared however I had to specified what function I want to run on "homepageTrigger". And of course I get application icon in right side panel (what I don't want to have). I really have no idea what can I do and reading Google documentation for last five days hasn't helped me at all.
@Thilina_madushan
@Thilina_madushan Жыл бұрын
I like your excellent explanation.👍❤ i have a question I want to send emails on a specific date. I want to send an email This should work after 3 days from the date of customer registration and continuously. For example " 2022.07.13 after registration then message should be sent on 16.07.2022. Date may change because customers can register anytime") How to send email with conditions.🤔 Please tell me how to do it Thank you very much 😊
@saperis
@saperis Жыл бұрын
I've never done anything like this. In theory, you would need to write a script that instantiates it's one time-based trigger. None of the default time-based triggers runs every three days. So again, you would have to write something yourself.
@Thilina_madushan
@Thilina_madushan Жыл бұрын
@@saperis Like a reminder.i found it.thank you 😊
@josephdaquila2479
@josephdaquila2479 5 ай бұрын
​@@Thilina_madushanyou had to go in and create new Triggers through the Google app scripts code?
@ThangTran-fe5oz
@ThangTran-fe5oz Жыл бұрын
I create trigger with newTrigger method. How to setup failure notifications without choose UI? Thanks
@saperis
@saperis Жыл бұрын
Good questions. I've never looked into that so I have no suggestion.
@sajidshahzad7995
@sajidshahzad7995 Жыл бұрын
i want protect or hide my script code of google sheet from another person. How it possiable?
@andersong855
@andersong855 3 жыл бұрын
Is there any way to reload the page via script. In case I'm using Google slide
@saperis
@saperis 3 жыл бұрын
I couldn't find any "reload" method on the documentation. I guess your best bet would be to trigger a reloading of the page by opening it: var preso = SlidesApp.openById('PRESENTATION_ID_GOES_HERE');
@krishnajannu
@krishnajannu Жыл бұрын
Can we triggered google app script to send emails when new row added to spreadsheet.
@saperis
@saperis Жыл бұрын
No, because the onEdit trigger is a simple trigger. Such simple triggers can't send out emails. Find out more in the official documentation: developers.google.com/apps-script/guides/triggers
@clementwalter4126
@clementwalter4126 2 жыл бұрын
I don't get where to place the code for the installable trigger "programmatic managing of triggers" and whether or not I have to use the pop up trigger tool window. thanks
@saperis
@saperis 2 жыл бұрын
These triggers you have to write in the script editor. Here is the information about it: developers.google.com/apps-script/guides/triggers/installable
@clementwalter4126
@clementwalter4126 2 жыл бұрын
@@saperis thanks for the link; but I don't get where to place this code, I mean, how google app knows when and how to run it. Is it enough to place it in a trigger/trigger.gs file? should I place this in onOpen function?
@saperis
@saperis 2 жыл бұрын
You add these triggers to your files. If you want to you can add a separate file or use the file you already have. The type of installable triggers are all mentioned in that documentation I shared with you. You especially have to check the section about managing the manual triggers as it contains the information you are requesting here: developers.google.com/apps-script/guides/triggers/installable#managing_triggers_manually
@mcfixit868
@mcfixit868 Жыл бұрын
I've never gotten an email about a trigger script error.
@saperis
@saperis Жыл бұрын
That's great. No email = no error. 😀
@yogendragehlot7344
@yogendragehlot7344 Жыл бұрын
How can run a macro automatically after every 5 minutes
@saperis
@saperis Жыл бұрын
You would have to set up a time-based trigger. Check this video: kzbin.info/www/bejne/gXSaoXWgeZh6fdk
@dixitpatel2873
@dixitpatel2873 Жыл бұрын
Hello
@dixitpatel2873
@dixitpatel2873 Жыл бұрын
How to add Trigger for Monday to Friday, 9 to 3 PM, Every Minute... Alll Three Together...
@saperis
@saperis Жыл бұрын
That's currently not possible with the installable triggers. You could try creating the trigger programmatically to achieve this: developers.google.com/apps-script/guides/triggers/installable?hl=en#managing_triggers_programmatically
@azleeeffendy305
@azleeeffendy305 8 ай бұрын
@@saperis How to add Trigger for weekday rush hour, 7 to 9 AM and 5 to 7 PM, Every 5 Minutes, to log duration from home to office?
@Grant-wm9ud
@Grant-wm9ud 2 жыл бұрын
i think i'm triggered by triggers
@saperis
@saperis 2 жыл бұрын
That comment triggers my method smileOnMyFace(). 😉
Google Apps Script Spreadsheet Service - How to use it
5:55
saperis
Рет қаралды 3,5 М.
Google Apps Script Tutorial for Beginners
23:54
saperis
Рет қаралды 364 М.
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 58 МЛН
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 26 МЛН
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 85 МЛН
How to Copy a Row to another Sheet with Google Apps Script
15:18
Google Apps Script: How to get Spreadsheet
12:39
saperis
Рет қаралды 14 М.
Google Apps Script - Google Drive Tutorial, Files, Folders, Copy Files, DriveApp, Iterator - Part 15
29:31
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 129 М.
Google Sheets onEdit Trigger - Automatically Drag Down Formulas - Apps Script
25:03
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 86 М.
Google Apps Script WEB APP with React JS and Router Tutorial
46:24
Get __it Done!
Рет қаралды 20 М.
Time Based Trigger - Apps Script | Script Service ~ Episode 3.1
12:42
This INCREDIBLE trick will speed up your data processes.
12:54
Rob Mulla
Рет қаралды 258 М.
Make an API With Google Sheets and Google Apps Script
15:53
Cukmekerb's Coding Class
Рет қаралды 60 М.
Google Apps Script For Loop
19:09
saperis
Рет қаралды 19 М.
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 58 МЛН