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
- 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. For example:
- 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 once 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 application version and bots.
How bots are triggered
Bots can be configured to trigger a process based on a data change event or according to a predetermined schedule.
Bots with data change events
You can create bots that are triggered by a data change event, such as:
-
Data is added, updated, or deleted. For example, you can trigger a bot when:
-
A new row is added.
-
An existing row is updated. 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.
-
-
A data change action is invoked on the AppSheet client.
-
An add, update, or delete is performed using the AppSheet API.
The data change that triggers a bot can be any type of data change 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 data change is 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 data changes that trigger the bot when configuring the event. For example, you could trigger a bot for the following data 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, and the value in the
InspectionPassed
column isFALSE
. -
A row is updated in the
Orders
table, 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.
Bots with scheduled events
Alternatively, you can use a bot that is triggered on a schedule you specify. Just like a data change-triggered bot, a scheduled-triggered bot is capable of working on any table and performing a wide variety of functions. See Understanding bot scheduling and retry.
How bots are not triggered
Bots are not triggered by:
-
Changes made directly to the spreadsheet or database
Changes you make directly to the spreadsheet or database do not go through the AppSheet server, so they do not trigger AppSheet bots. For example, if you update a Google Sheet directly, Google Sheets does not notify the AppSheet server about the change. Since the AppSheet server is unaware of this change, it does not trigger any AppSheet bots.
For Google Sheets only, you can enable external eventing to set up a bot that triggers a process when a data change happens in Google Sheets. For more information, see External eventing with Google Sheets. -
Data change actions invoked by a bot unless that bot that makes that data changes has been explicitly configured to trigger other bots.
Data change actions that are invoked by bots do not 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 will not invoke any bots. -
Changes made through another AppSheet application, even if that application 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.
Application version and bots
Each time you change your application, AppSheet creates a new version of your application. These changes may include changes to your bots.
AppSheet includes the application 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 application.
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 application version number.
After the user has submitted their changes, the AppSheet client performs a sync that retrieves the latest data and application version. Any future changes will be submitted using that application 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 by selecting one of the following:
- Save - Save the app.
- Save & verify data - Save the app and verify that it is runnable based on external dependencies.
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 by selecting one of the following:
- Save - Save the app.
- Save & verify data - Save the app and verify that it is runnable based on external dependencies.
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 by selecting one of the following:
- Save - Save the app.
- Save & verify data - Save the app and verify that it is runnable based on external dependencies.
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
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:
-
To add a comment to 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.
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.