Triggers help Apps Program run a function automatically when a specific feel, such as for instance opening a file, occurs

Triggers help Apps Program run a function automatically when a specific feel, such as for instance opening a file, occurs

Triggers help Apps Program run a function automatically when a specific feel, such as for instance opening a file, occurs

Easy causes was a couple of kepted properties built into Applications Program, like the function onOpen(e) , and this executes when a person opens up a yahoo Docs, Sheets, Slides, otherwise Models document. Installable produces provide more possibilities than just easy produces however, should be triggered in advance of play with. Both for sort of leads to, Software Software entry the new caused mode a meeting target which includes information regarding new perspective where in actuality the feel taken place.

Getting started

  • onOpen(e) runs whenever a person reveals an excellent spreadsheet, file, presentation, otherwise setting that affiliate enjoys permission to help you modify.
  • onInstall(e) operates when a person installs an editor include-towards the from the inside Bing Docs, Sheets, Glides, otherwise Versions.
  • onEdit(e) works when a person changes an admiration from inside the a great spreadsheet.
  • onSelectionChange(e) operates when a user changes the selection inside a good spreadsheet.
  • doGet(e) runs whenever a person visits a web software otherwise a program sends an enthusiastic HTTP Get request to help you a web application.
  • doPost(e) runs when a course directs an enthusiastic HTTP Article demand so you’re able to good websites software.

The fresh new age parameter regarding the function labels above try a conference object which is enacted to the means. The item include details about the brand new context that was the cause of end up in so you can fire, however, utilizing it try recommended.


  • The latest program need to be destined to a google Sheet sets, Slides, Docs, or Models file, if not end up being a provide-on that expands one of those software.
  • They do not focus on if the a document is actually started for the discover-merely (see otherwise feedback) function.
  • Program executions and you will API desires do not cause triggers to perform. Instance, calling Range.setValue() in order to revise a mobile does not cause the spreadsheet’s onEdit bring about to operate.


The fresh new onOpen(e) bring about runs automatically when a user opens a good spreadsheet, file, speech, otherwise setting they own permission in order to edit. (The latest lead to doesn’t focus on when responding to a type, only when opening the proper execution so you’re able to modify they.) onOpen(e) was mostly accustomed include custom menu items to Yahoo Sheets, Slides, Docs, or Models.


New onInstall(e) lead to operates automatically when a person installs a publisher incorporate-into from the inside Yahoo Docs, Sheets, Glides, or Variations. The latest produce wouldn’t focus on when a person installs the fresh create-on the from the Google Workplace Areas web site. Observe that there are specific limitations about what onInstall(e) can do, find out more about consent. The most famous access to onInstall(e) is basically to-name onOpen(e) to include individualized menus. At all, when a provide-with the is actually strung, new document is discover, which means onOpen(e) doesn’t operate on its until the fresh document is reopened.


The onEdit(e) produce operates automatically when a user changes the worth of one cellphone within the good spreadsheet. Very onEdit(e) produces utilize the advice whether or not object to respond correctly. Such as for instance, the fresh new onEdit(e) mode below establishes a touch upon the new cellphone you to suggestions the brand new past date it actually was modified.


The fresh new onSelectionChange(e) end up in works immediately whenever a person changes the option inside good spreadsheet. To engage which end in, you need to refresh the brand new spreadsheet due to the fact result in is actually additional and you will anytime new spreadsheet are exposed.

In case your choices movements anywhere between multiple structure very quickly, certain choice alter incidents was skipped to reduce latency. Eg, in the event that of many choice change are designed in this a few mere seconds each and every almost every other, just the first and last alternatives transform often activate the fresh new onSelectionChange(e) cause.

doGet(e) and you may doPost(e)

The fresh new doGet(e) trigger runs immediately whenever a person check outs a web app otherwise a program directs a keen HTTP Rating demand so you can a web site application. doPost(e) operates whenever a program directs a keen HTTP Blog post consult so you’re able to good net software. This type of leads to was shown even more regarding the instructions in order to net programs, HTML services, and you may Blogs provider. Note that doGet(e) and you will doPost(e) aren’t susceptible to the new restrictions in the above list.

Offered types of causes

In the event your restrictions towards the easy leads to have them regarding fulfilling the demands, a keen installable trigger my work instead. The table below summarizes and this variety of trigger are offered for each type off skills. Such as, Google Sheet sets, Glides, Forms, and you can Docs all of the assistance effortless discover produces, however, merely Sheet sets, Docs and you will Variations assistance installable open causes.

Geen reactie's

Geef een reactie