Templates enable you to more precisely control the appearance of content sent from an automation bot. When configuring your bot, you build templates to customize the following content:
Use templates in an automation in one of the following ways:
- Build your template content directly in the editor when configuring your automation. See also Build templates using the Template Assistant.
- Use an external template. For example a template built using Google Docs or Microsoft Word.
Build your template content
In general, you can include the following content in a template:
- Text
- Images
- Variables that refer to column values in your tables
- Expressions that yield computed values
- Start expressions that display the rows of a table
- If expressions that allow you to include or exclude portions of a template
The final result will contain the template contents with all variables and expressions resolved.
For additional template formatting tips and examples, see the following topics:
- Display images, thumbnails, drawings, and signatures in templates
- Display Address, LatLong, and XY values in templates
- Use CONCATENATE(), Ampersand operators, and text expressions in templates
- Sample email templates
Use external templates
You can using an external template to build your template content as described in the following sections:
- Supported external template content types
- Create an external template
- Manually create an external template
- Use an external template
- Configure the data sources for storing the external templates
See also: Use and troubleshoot custom fonts in templates
Supported external template content types
AppSheet supports the content types defined in the following table for external templates. Learn more about creating and customizing external templates for a particular content type using the links provided.
Template |
Supported content types |
Email body |
|
Email attachment, file, or webhook
|
|
SMS |
Create an external template
Create an external template as described in the following table. See also Create a Microsoft Word template on Google Drive.
Content |
Steps to create an external template |
Email body |
For more information, see Send an email from a bot. |
Email attachment |
For more information, see Send an email from a bot. |
File |
For more information, see Create and save a file from a bot. |
SMS |
|
Webhook |
If you are using the webhook to invoke the AppSheet API, configure the webhook URL value when configuring the webhook before clicking the Create button. AppSheet examines the webhook URL value to determine if the AppSheet API is being invoked. If so, AppSheet uses the table name you specify following If your table contains a List of Refs to related child records, the created JSON Body Template file will include a Start expression that extracts the data values of all child records of the parent record. If the child table contains a List of Refs to related grandchild records, the created JSON Body Template file will include a Start expression that extracts the data values of all grandchild records of the child records. The created JSON Body Template file will extract the parent record, the child records, the grandchild records, the great grandchild records, and so on. This allow you to extract the entire hierarchy of records. For more information, see Call a webhook from a bot. |
In each case, AppSheet creates the template and writes it to your default data source unless it is explicitly set. To explicitly set the data source, see Configure the data sources for templates (below).
By default, AppSheet uses the following file naming conventions similar to the following to ensure the template name is unique:
Content/task-name_BodyTemplate_yyyymmdd_hhmmss
Content/task-name_AttachmentTemplate_yyyymmdd_hhmmss
Click View to view the template and customize the template, as required.
Note: The template properties reference 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 event for each template file and specify an expression in the Condition property to select which event to invoke.
Manually create an external template
You can manually create an external template and upload it to one of the the data sources described in Configure the data sources for templates. Then, follow the steps in the next section, Use an existing external template.
Use an existing external template
To use an existing external template:
- Create or open an existing task.
- Disable Use default content? (if applicable).
- Click the Browse icon adjacent to the template property.
- Select the data source using the Get data from... dialog box when prompted, then select an existing template file.
- Click View to view the template and customize the template, as required.
Configure the data sources for storing external templates
To use external templates, your account must include one or more of the supported data sources listed below. To add a new data source, see Use multiple data sources.
AppSheet supports the following data source for Google Doc template formats:
-
Google Drive
AppSheet supports the following data sources for all other template formats:
- Box
- Dropbox
- Google Drive
- Microsoft Office 365
- Microsoft OneDrive
An external template is stored on your default data source unless it is explicitly set. For example, if your default data source is Google, when you click Create, the new template is created on your Google Drive. Similarly, if your default data source is Box, Dropbox, Microsoft Office 365, or Microsoft OneDrive, when you click Create, the template file is created on that data source.
To explicitly set the data source to use for an external template:
- Set the associated Data Source or File Store property, if applicable.
- Click the Browse icon adjacent to the template property and select the data source using the Get data from... dialog box, then select an existing template file.
- Note: If you click Create after browsing for an existing template file, the new template will be saved to the data source you selected while browsing.