This is a beta release of building automations using Gmail events. See Track and manage feature releases . Preview offerings are intended for use in test environments only. This feature is not recommended for use in production apps. For questions or assistance with this feature, contact AppSheet Support .
You must be a Google Workspace userto build AppSheet automations with Gmail. See Add AppSheet to Google Workspace .
If you are using your Google Workspace account, the Google Workspace Terms of Service govern your use of Gmail. Otherwise, refer to the Google Terms of Service .
To create your first automation using Gmail, perform the following steps:
Create an app from a template
To create an app from the IT Ticketing template, do the following:
- Open the Project Tracker template.
- Click Copy and Customize.
The Clone your app dialog opens. - Click Copy app.
Your app is created from the template and opened in the app editor. By default, the Learning Center is displayed. -
Go to Data .
The Data pane is displayed and the first table in the primary navigation is opened in the editor.
Notice that there are four tables,Notes
,People
,Tracker
, andWorkstreams
. TheTracker
table has table slices defined to access workstreams based on the status of the project. -
Click View data sourcein the top navigation to open the Google Sheet data source used by the app.
The Tracker Sheet is opened in a separate tab. Leave the spreadsheet open -- you'll refer back to it later when testing your automation.
Next you'll add a Gmail event automation that triggers an automation when a label is added to a project email message in your Gmail. You'll then capture the project information from the email message in the Tracker
spreadsheet.
Build an automation based on a Gmail event
To build an automation based on a Gmail event:
- Return to the AppSheet editor tab.
- Go to Automation
> Bots.
Currently, the app has an automation defined to send an email to task owners for incomplete tasks that are due today. The bot shows a warning because the app isn't deployed. This message can be ignored for now. - Click +in the top header of the Bots panel.
The Add a new bot dialog is opened. - In the Add a new bot dialog, click Create a new bot.
A new empty bot is created and displayed in the center pane of the app editor. - To edit the name of the bot, do the following:
- Position your cursor over the New Bot in the left navigation pane.
- Select More
> Rename.
- Replace the text with Urgent projectand press Enter.
- In the new bot flow in the center pane, click Configure event.
- For event name, enter Urgent project received and click Create a new event.
The Settings pane opens in the right side of the app editor. - In the Settings pane, configure the event as follows:
- In the Event source drop-down, select Gmail (Beta).
- To connect your Gmail account as a data source, click Authorize.
The Add a new data source dialog displays. - Click Gmail (beta).
The Choose an account dialog displays. - Click your Gmail account and then respond to the remaining prompts to add your Gmail account as a data source and connect it to the app.
- In the Gmail accountdrop-down, select the account you just added.
- In the Label to watchdrop-down, select Starred. Note: For simplicity, you're using one of the default Gmail labels. Typically, you'll create a custom label for use with your automation. See Create labels to organize Gmail and Create rules to filter your emails .
- Select the following trigger actions:
- Added label to email
- Removed label from email
- In the bot flow in the center pane, click + Add a step.
- In the Step namefield, enter Save project details and click Create a new step.
- Click the Save project detailsstep in the center pane and select Run a data action in the drop-down.
The Settings pane is updated. - In the Settings pane, configure the step as follows:
- Leave Add new rows selected as the data action.
- In the Add row to this tabledrop-down, select Tracker.
You'll add a new row to the Tracker spreadsheet using the values defined in the next step. - Under With these values, follow these steps to add the following values: ValueStepsWorkstream
- Select Workstreamin the drop-down.
- Click in the value field to open the Expression Assistant.
- In the expression text box, enter: "0.3399913417"
Include the surrounding quotes. This ID corresponds to the ProjectA workstream in theWorkstreams
spreadsheet. Let's assume that this workstream tracks urgent projects. - Click Save.
The Expression Assistant is closed.
Task- Click Add.
- Select Taskin the drop-down.
- Click in the value field to open the Expression Assistant.
- Click the Examplestab and then click Columns.
- Locate the row with [Subject]in the Examplecolumn and click Insert.
- Click Save.
The Expression Assistant is closed.
Description- Click Add.
- Select Descriptionin the drop-down.
- Click in the value field to open the Expression Assistant.
- In the Examples tab, click Columns.
- Locate the row with [Body]in the Examplecolumn and click Insert.
- Click Save.
Owner- Click Add.
- Select Ownerin the drop-down.
- Click in the value field to open the Expression Assistant.
- In the text box, enter: "IT@company.com"
Include the surrounding quotes. - Click Save.
Due- Click Add.
- Select Due in the drop-down.
- Click in the value field to open the Expression Assistant.
- In the text box, enter: TODAY()+1
Due to its urgent nature, you're indicating that the project needs to be resolved in 24 hours. - Click Save.
Status- Click Add.
- Select Statusfrom the drop-down.
- Click in the value field to open the Expression Assistant.
- In the text box, enter: "Not Started"
Include the surrounding quotes and match the capitalization. - Click Save.
- Click Saveto save the app.
Next, you'll test your automation.
Test your automation
To test the automation:
- Go to your Gmail account.
- Compose an email with the following content and send it to the yourself:
- Email Subject: Issue #5555555
- Email body: Monitor removal from conference room C
- Check your inbox for the message.
- Click the staricon adjacent to the message to trigger the automation.
- Navigate back to the browser tab with the Trackersheet.
- Make sure that the Tracker spreadsheet tab is selected and confirm that a new row has been added to track the project:
Congratulations!You have built your first app and automation using Gmail.
What's next?You can access more quick starts to learn about other AppSheet features.