How can I automatically run a Google Script Function when my Spreadsheet is edited?
-
I have a script that I would like to automatically run when my spredsheed has been edited. I've seen onEdit function, but I don't understand how to use it to run my script. In my spreadsheet new rows are added by an IFTTT Recipe, then I would like to run my function when this type of change is verified.
-
Answer:
The onEdit() trigger is the way to go. Here's a simple example pulled straight from the documentation: function onEdit(event) { var ss = event.source.getActiveSheet(); var r = event.source.getActiveRange(); r.setComment("Last modified: " + (new Date())); } Inside the body of the function you can do a variety of things. If you need access to authorized services (such as Gmail, Calendar, etc) then you'll need to create an installable trigger instead. https://developers.google.com/apps-script/understanding_triggers
Eric Koleda at Quora Visit the source
Related Q & A:
- How can I auto run ccleaner on Mac OS X?Best solution by forum.piriform.com
- How can I merge all my Google calendars into my primary one?Best solution by Quora
- How can i upload photos on google?Best solution by Quora
- How can I delete photos in Google plus?Best solution by Quora
- How Can I Block Ads On Google Chrome?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.