Understand and manage bots as described in the following sections:
- What is a bot?
- Explore bot management
- Add a bot
- Configure a bot
- Set the icon for a bot
- Rename a bot
- Add a comment to a bot
- Copy a bot
- Monitor a bot
- Test a bot
- Run a bot with a scheduled event
- Enable or disable a bot
- Delete a bot
See also Monitor automation.
What is a bot?
A bot defines the automation you want AppSheet to run:
when something happens (an event) perform a set of activities (each activity is a task and a set of tasks is a process).
Bots can perform a wide variety of functions. Here are some examples:
- Create and send an email, SMS message, or notification regarding the modified record.
- Further update the modified record.
- Update the parent record of the modified record.
- Add, update, or delete child records belonging to the modified record.
- Call a webhook to invoke an external web service.
You can perform a wide variety of other functions because after the bot is triggered, it is capable of working on any table and doing almost anything. Once enabled, bots run in the background to listen for events or trigger processes on a schedule even when you are not directly using an app. To terminate the process automation, you can disable the bot.
For example, the Confirmed appointment bot is configured to trigger the User notification of confirmed appointment process anytime an Appointments record is updated to notify the user that their requested appointment has been confirmed. The bot continues to listen for the appointment update events and fire the associated process when the event occurs until it is disabled.
Learn more about how bots are triggered and not triggered, and the relationship between the app version and bots.
How bots are triggered
Bots can be configured to trigger a process based on:
- An app event.
- A modification to one or more columns in an AppSheet database.
- A predetermined schedule.
- A Google Workspace interaction.
App events
Bots can be configured to trigger a process based on an app event, including the following:
-
Data is added, updated, or deleted through the app. For example, you can trigger a bot when:
-
A new row is added through the app.
-
An existing row is updated through the app. For example, the update may occur as the result of editing a row in a form view, or performing a quick edit, or invoking a client action through a user button click.
-
An existing row is deleted through the app.
-
-
A data change action is invoked on the AppSheet client.
-
An add, update, or delete operation is performed using the AppSheet API.
The app event that triggers a bot can be any type of data change made through the app that arrives at the server. For example, you can add an extra table column whose only purpose is to trigger a bot. Then, you can create a client action button that updates the extra column's value. Clicking the action button triggers your bot.
After the app changes are synced to the server, AppSheet:
-
Makes the appropriate changes to the spreadsheet or database.
-
Ensures that any formulas in the spreadsheet are re-computed to use the latest data values.
-
Determines whether your bot should be triggered.
To further restrict when a bot is triggered, you can specify the following:
-
Type of app changes that trigger the bot when configuring the event. For example, you could trigger a bot for the following changes:
-
All changes
-
Adds only
-
Adds and updates
-
Adds and deletes
-
Deletes only
-
Updates and deletes
-
Updates only
-
-
Condition that triggers the bot when configuring the event. For example, you could trigger a bot when:
-
A new row is added to the Inspections table though the app, and the value in the
InspectionPassed
column isFALSE
. -
A row is updated in the
Orders
table through the app, the value in theOrderAmount
column is over $500, and the value in theDeliveryDate
column is within 10 days of the current date.
-
-
Whether a bot can trigger other bots and, if so, whether to sync data changes only after this bot and all bots that it triggers complete their execution when creating a bot.
AppSheet database events
Bots can be configured to trigger a process based on modifications to one or more columns in a connected AppSheet database.
Scheduled events
Bots can be configured to trigger a process based on a schedule. Just like an app event, a scheduled event is capable of working on any table and performing a wide variety of functions. See also Events: The Essentials and Understanding bot scheduling and retry.
Workspace interactions
Bots can be configured to trigger based on Workspace interactions, including:
- Google Chat app interaction.
- Form built with Google Forms is submitted.
See also Events: The Essentials.
How bots are not triggered
Bots are not triggered by:
-
Changes made directly to data sources (except AppSheet databases)
With the exception of AppSheet database events, changes you make directly to the data source (spreadsheet or database) don't go through the AppSheet server, so they don't trigger AppSheet bots. For example, if you update a BigQuery database directly, it doesn't notify the AppSheet server about the change. Since the AppSheet server is unaware of this change, it doesn't trigger any AppSheet bots. -
Data change actions invoked by a bot unless the bot that makes the data changes has been explicitly configured to trigger other bots
Data change actions that are invoked by bots don't trigger other AppSheet bots. For example, if a client device performs an add, update, or delete that triggers a bot, and that bot invokes a data-change action, that data change action won't invoke any bots. -
Changes made through another AppSheet app, even if that app is using the same underlying spreadsheet or database table
This is true even if the two AppSheet apps share the same underlying spreadsheet or database table. For example, you might have a Payroll app and a separate Personnel app that share an Employees table. Bots defined in the Payroll app will only be triggered by adds, updates, or deletes to the Employees table that are performed through the Payroll app. Adds, updates, or deletes to the Employees table that are performed through the Personnel app will not trigger bots defined in the Payroll app. In short, bots only work within a single AppSheet app; they do not work across two or more apps, even if those apps share common underlying spreadsheet or database tables.
App version and bots
Each time you change your app, AppSheet creates a new version. These changes may include changes to your bots.
AppSheet includes the app version each time a user submits their adds, updates, or deletes to the server. This is essential because the user may be submitting changes based on an older version of your app.
When invoking bots, AppSheet invokes the version of the bots that match the user's version. This may result in invoking an older version of your bot. You can detect when this occurs by examining the audit history. The audit history includes the app version number.
After the user has submitted their changes, the AppSheet client performs a sync that retrieves the latest data and app version. Any future changes will be submitted using that app version.
Explore bot management
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
This section explores how to manage bots using the new editor (preview) only.
Go to Automation > Bots.
The Bots panel is displayed and the first bot in the list is opened in the editor.
As highlighted in the previous figure, you manage bots by performing the following tasks:
- Add a bot
- Edit a bot by selecting it in the Bots panel
- Manage bot components, including events, processes, steps, and tasks
- Configure a bot
- Enable or disable a bot
- Monitor a bot
- Manage a bot:
- View error and warning messages that are related to bots by clicking the error or warning indicator in the bot header
- Search all bots
Add a bot
To add a bot:
-
Open the app in the app editor.
-
Go to Automation > Bots and click + in the top header of the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and click + New Bot.
-
Perform one of the following tasks:
-
Choose from the list of suggestions. AppSheet Automation is an intent-aware platform. The platform understands user intent and recommends configuration options that align with what you are trying to achieve. For example, selecting the following bot suggestion would create a fully configured bot:
When employees record is updated, send an email -
Create a custom bot. Click Create a new bot.
-
- Add and configure an event.
- Configure the process, including the steps and tasks.
- Optionally, do one or more of the following:
- Save the bot.
Configure a bot
To configure the bot to trigger other bots:
- Go to Automation > Bots and select the bot you want to configure in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot for which you want to set an icon.
- Expand the Options section.
-
Configure the following advanced settings to control the behavior of your bot:
Option Description Trigger other bots Enable this option to allow data change steps in this bot to execute other bots that are listening for the same data change events. Disable this option to prevent data change events triggered by the current bot from triggering other bots.For scheduled events, this setting is valid in the following scenarios:- If ForEachRowInTable is enabled and a data change step is included in the process.
- If ForEachRowInTable is disabled and a Call a process step that includes a data change event is included in the process.
If enabled, the following policies are enforced to avoid infinite event-trigger loops:
-
An event that is a result of a data change made by the bot cannot subsequently trigger the same bot.
-
If two or more bots trigger one another continuously in succession, the maximum number of triggers that can be initiated between them is 5. For example:
-
Bot A triggers Bot B
-
Bot B triggers Bot A
-
Bot A triggers Bot B
-
Bot B triggers Bot A
-
Bot A triggers Bot B
-
Wait for execution to complete Note: This option is available only if the Trigger other bots option is enabled.Enable this option to instruct the app to sync data changes only after this bot and all bots that it triggers complete their execution. Disable this option to instruct the app to sync data after this bot completes its execution, even if there are triggered bots still executing in the background.
-
Save the bot.
Set the icon for a bot
The bot icon can provide easy identification.
To set the icon for a bot:
- Go to Automation > Bots and select the bot you want to configure in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot for which you want to set an icon.
- Expand the Options section.
- Search for and select the desired icon in the Bot icon field.
-
Save the bot.
Rename a bot
To rename a bot:
- Go to Automation > Bots and double-click the bot you want to rename in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot that you want to rename.
- Position your cursor over the bot you want to rename in the Bots navigation panel.
- Select More > Rename in the bot header.
- Rename the bot.
Alternatively, you can double-click the name of the bot in the Bots panel and edit the name.
Add a comment to a bot
To add a comment to a bot:
- Go to Automation > Bots and select the bot you want to rename in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot for which you want to set an icon.
- Expand the Documentation section.
- Enter a descriptive comment for the bot that will enable collaborators to easily understand its purpose.
Copy a bot
Copy the contents of a bot. A numeric value (such as 2) is appended to the bot and event names to ensure they are unique.
To copy a bot:
- Go to Automation > Bots.
- Select the bot you want to copy in the list.
- Select More > Duplicate in the bot header.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
If you are using the legacy editor
To copy a bot:
- Go to Automation > Bots.
- Expand the bot you want to copy.
- Click Copy in the bot heading.
Monitor a bot
Use the AppSheet automation monitor to monitor automation in your apps and keep a track of the bot executions that were successful, encountered errors, and are still pending
To monitor a bot:
To copy a bot:
- Go to Automation > Bots.
- Select the bot you want to monitor in the list.
- Click Monitor in the bot header.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
If you are using the legacy editor
To monitor a bot:
- Go to Automation > Bots.
- Expand the bot you want to monitor.
- Click Monitor in the bot heading.
Test a bot
Test a bot execution.
To test a bot:
-
Go to Automation > Bots and select the bot you want to test in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot you want to test.
- Select More > Test in the bot header.
Run a bot with a scheduled event
To run a bot with a scheduled event on demand:
-
Go to Automation > Bots and select the bot with the scheduled event that you want to test in the Bots panel.
We've made some improvements to the app editor.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.If you are using the legacy editor
Go to Automation > Bots and expand the bot you want to test.
- Click Run in the bot header.
Enable or disable a bot
You can disable the bot to temporarily stop the automation. Then, re-enable it.
To enable or disable a bot:
- Go to Automation > Bots.
- Select the bot you want to enable or disable in the list.
- Select Enable or Disable in the bot header.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
If you are using the legacy editor
To disable a bot:
- Go to Automation > Bots.
- Expand the bot you want to delete.
- Click Disable in the bot heading.
Delete a bot
Delete a bot to permanently remove it.
To delete a bot:
- Go to Automation > Bots.
- Select the bot you want to delete in the list.
- Select More > Delete in the bot header.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.
If you are using the legacy editor
To delete a bot:
- Go to Automation > Bots.
- Expand the bot you want to delete.
- Click Delete in the bot heading.