Actions & Triggers are a way to automatically take an action related to specific records in a GW Apps application. For example, in a service request application you could create a trigger to send an email to the manager of a service technician for every service request that has been assigned to the tech, is not yet resolved and was assigned three or more days ago. That way, service requests that are not being dealt with in a timely manner will escalate themselves to the service tech’s manager.
An App Designer can create and edit triggers from the Actions & Triggers Dashboard. To access the Actions & Triggers Dashboard:
|Edit App > Actions & Triggers|
Actions & Triggers Dashboard
The Actions & Triggers Dashboard shows all available triggers for the current application, displayed as a list. An App Designer can create and update them from here. Each trigger has it’s own row menu (three vertical dots on the far right side) which lets you work with the trigger.
|Actions & Triggers Dashboard|
Each trigger row has the following options:
|Status||A toggle to enable and disable the trigger. Enabled triggers will be evaluated and run, while disabled ones are inactive.|
|Edit||Opens the trigger to be edited. (See Creating a new Trigger, below, for details of the Trigger Form.)|
|Remove||Deletes the trigger from the application.|
|History||Displays the edit and run history for the trigger.|
Creating a new Trigger
To create a new trigger, click on the + Create New Trigger button at the top of the dashboard. You will then be presented with the Trigger Form:
|Name (A)||Enter the name of the new trigger.|
|Description (B)||If desired, enter a description for the trigger to help clarify its purpose. [Optional]|
|Trigger Type (C)||Select ‘Scheduled’ for a trigger that will automatically start on a regular schedule. (Other trigger types will be offered at a later date.)|
|Target Form (D)||Select the form whose records you would like the trigger to act on.|
|Trigger Schedule (E)||Does this action repeat in a way that is best described in terms of days, months or years? For example: if it should run every 3 days then select ‘Daily’, if it should run every other month on the 3rd then select ‘Monthly’, and if it should run on the 1st day of January, June and December then select ‘Yearly’.|
|Repeat Every (F)||How many days, months or years should the action wait in between each time it is triggered. If you wanted to have it run every day, you would have to select ‘Daily’ for the Trigger Schedule and ‘1’ for this field. If you wanted to have it run every 3 months, you would have to select ‘Monthly’ for the Trigger Schedule and ‘3’ for this field.|
|Hour of the Day (G)||What time of day would you like the action to be triggered, or if you want it to run more than once per day, which times. Scheduled triggers can’t be set to run at an exact time of day, so this field shows the hours as time ranges of one hour long, i.e. ‘3pm ~ 4pm’. The action will run at some time within that hour long window.|
|Time Zone (H)||As GW Apps runs on the global Google cloud, we need to specify which time zone the ‘Hour of the Day’ setting should be in.|
|Starts on (I)||Allows you to specify a date before which the trigger will not run. Before that date, it is considered disabled. [Optional]|
|Ends on (J)||Allows you to specify a date after which the trigger will not run. On or after that date, it is considered disabled. [Optional]|
After selecting the Target Form, two additional form sections are displayed at the bottom of the form:
|Filters (K)||Enter the name of the new trigger.|
|Actions (L)||Select ‘Send Email’ from the Select Action list, then either select an existing email template or create a new one. For details on working with email templates >|
Setting a Filter Value
Filters in triggers work the same way they do in lookup fields on forms and in view filtering, so if you are familiar with filters there you will know how to set them in triggers.
There are two main steps to adding a filter: Selecting the field on the lookup form to compare with, along with the comparison operator, and then in step 2 you define what you are comparing against.
|Adding a Filter – Step 1|
|Click on this icon to add a new filter. You can have as many concurrent filters as you need. If you add more than one filter, then all filter conditions must be met simultaneously. (They are combined with a logical AND.)|
|Delete: Click on this icon to delete the associated filter.|
|Field Name||Select the field on the target form you would like to filter based upon: i.e. Product Name, Department, etc.|
|Operator||Select the desired logical operator for the comparison.
The options vary depending on the data type of the field selected in Field. The options are:For Text type fields and pick from list type fields (Radio Button, Checkbox, List Selection, Multi Lookup):
For Date type fields:
Equals and does not equal require the entire compared value to match/not match: e.g. “Department” does not match “IT Department” when using equals as the whole value is not the same.
Contains and does not contain just searches for the specified text in the comparison value to see if it is there at all. The entire compared value is not required to match: e.g. “Department” does match “IT Department” when using contains.
|Adding a Filter – Step 2|
|Enter the actual value to compare against: e.g. if you were filtering the trigger so it only ran on records where the project area field contained ‘IT’, then simply type ‘IT’ in this field.
The type of data entry field you will see will depend on the data type of the field selected in ‘Field Name’.
Note: There is no ‘Local Field’ option in filtering for triggers.