Triggers are rules that perform actions or invoke functions in response to events such as matching conditions or database changes. Use with an applicable database, platform, product, or service tag where possible. Always use with corresponding language tag.
About
Triggers are rules that perform one or more actions upon matching a condition. They can be defined at various levels of applications and processes (such as database triggers to change data, UI triggers to change properties or fire events, and function triggers to invoke functions).
Database Triggers
A Database Trigger, in general, are stored procedures that are automatically invoked upon events occurring in a database.
Use with database-trigger
Useful Resources
WPF triggers
Windows Presentation Framework (WPF) Trigger - the properties changed by triggers are automatically reset to their previous value when the condition is no longer satisfied.
Use with wpf and .net-core or c# where applicable
DML Triggers
Data Manipulation Language (DML) triggers are stored procedures that fire upon DML events like INSERT
, DELETE
, or UPDATE
occurring on the table or view.
DML Triggers can work on different levels:
- Row Level (executed for each row affected)
- Statement Level (executed once no matter how many rows are affected)
The trigger is mostly used for maintaining the integrity of the information on the database.
Usage Guidance
Use with relevant database tag: mysqloraclepostgresqlsql-server
Useful Resources
- SQL Server and Azure SQL DML triggers
- PostgreSQL event triggers
- Row and Statement triggers for Oracle DB
System Triggers
System triggers execute in response to certain actions occurring in the database such as user logging on or off (LOGON
& LOGOFF
), startup or shutdown (STARTUP
& SHUTDOWN
), server error (SERVERERROR
) events, or data definition language (DDL) statements are run.
Useful Resources
Function Triggers
Azure function triggers
Triggers define how and when Azure Functions run, provide input data to them or connect other resources via input/output bindings. Triggers and bindings for them are defined in function.json
file.
Usage Guidance
Always use with azure. Use with azure-functions and appropriate language tag (where applicable).
Useful Resources
Google Apps Script triggers
Triggers in Google Apps Script automatically run a function on a certain event firing. There are 2 types of them:
Simple triggers that respond to events such as onOpen
or onChange
in container-bound scripts.
Installable triggers can call services that have to be authorized by the user, can be scheduled (in case of time-driven triggers), and programmatically managed.
Usage guidance
Use for questions about Google Apps Script triggers both simple and installable.
Always use together with google-apps-script tag.
For G Suite application triggers use with product-specific tags:
google-sheets google-docs google-forms google-slides google-calendar
For Web Apps doGet
/doPost
triggers use with gas-web-app tag.
For onInstall
triggers use with google-apps-script-addon tag.
Useful Resources
- Simple triggers guide
- Installable triggers guide
- Trigger samples repo on GitHub
- Event object structures reference
Google Cloud Triggers
Cloud triggers run either Cloud Functions in response to an HTTP request or Background Functions on an event from Cloud Storage, Cloud Firestore, or Pub/Sub message.
Usage guidance
Always use with google-cloud-functions and with appropriate language tag where applicable. When asking about Background functions use an appropriate trigger tag:
google-cloud-pubsub for Cloud Pub/Sub
google-cloud-storage for Cloud Storage
google-cloud-firestore for cloud Firestore
Useful Resources
- Cloud Functions reference
- Writing a Background Function guide
- Public issue tracker