Learn more about sending email, using templates, and using expressions with workflow in the Workflow: Sending Email section.

Email Templates

You can control the content and format for your email body and attachment with a template. Your template may include:

The email body or attachment will contain your template with all variables and expressions evaluated and replaced with the resulting values, as described below.

You can use template files for both event-triggered and scheduled reports. The templates for both are largely identical, differing only in the start expression used to select the table rows being displayed.

Template Types

We support the following types of Body templates:

  1. Google Docs
  2. Microsoft Word

We support the following types of Attachment templates:

  1. Google Docs
  2. Microsoft Word
  3. Microsoft Excel
  4. CSV
  5. HTML
  6. JSON
  7. XML

Template Data Sources

We support Google Docs template files stored on these data sources:

  • Google Drive

We support Microsoft Word, Microsoft Excel, CSV, HTML, JSON, and XML template files stored on these data sources:

  • Box
  • Dropbox
  • Google Drive
  • Microsoft Office 365
  • Microsoft OneDrive

If you wish to use a workflow template, your account must include one or more of these data sources. You can add a new data source from the Account > Data Sources tab.

Creating a Workflow Template

You can ask AppSheet to create a template file. You can then customize the template file.

Creating a Body Template

Create a Body template file as follows:

  1. Add a new workflow or report and save it for the first time. Alternatively, open any existing workflow or report.
  2. Click the Create button following the Email Body Template property. When you click Create, AppSheet will create a Body template and write it to your default data source.
  3. The template will be given a unique name based on the workflow or report name, the template type (Attachment or Body), and the date and time you click Create, ensuring every template has a unique name.
  4. Click View to view and edit the new template file.

The Email Body Template property always refers to a single template file. You cannot use an expression to specify the template file. If you need to choose between two or more template files, define a separate workflow rule for each template file and specify an expression in the Condition property to select which workflow rule to invoke.

Creating an Attachment Template

Create an Attachment template file as follows:

  1. Add a new workflow or report and save it for the first time. Alternatively, open any existing workflow or report.
  2. Select a template type from the HTTP Attachment Content Type drop down.
  3. Click the Create button following the Attachment Template property. When you click Create, AppSheet will create an Attachment template and write it to your default data source.
  4. The template will be given a unique name based on the workflow or report name, the template type (Attachment or Body), and the date and time you click Create, ensuring every template has a unique name.
  5. Click View to view and edit the new template file.

The Email Attachment Template property always refers to a single template file. You cannot use an expression to specify the template file. If you need to choose between two or more template files, define a separate workflow rule for each template file and specify an expression in the Condition property to select which workflow rule to invoke.

Controlling the Workflow Template Data Source

By default, the template is created on your default data source. For example, if your default data source is Google, the Create button will create the template file on Google Drive. If your default data source is Box, Dropbox, Microsoft Office 365, or Microsoft OneDrive, the Create button will create the template file on that data source.

The Editor fields Email Body Template Data Source and Attachment Template Data Source indicate which data source contains your template files.

You can control which data source is used by clicking the Browse icon and selecting a template file using the Get data from ... dialog box. If you click the Create button after doing so, the created template will be saved on the data source you selected while browsing.

Google Docs and Microsoft Word Workflow Templates

You can use Google Docs or Microsoft Word documents as workflow templates. We recommend this because it allows you to easily and precisely control the appearance to your email body and attachment. To learn more see Google Docs Templates or Microsoft Word Templates.

Did this answer your question?