Gmail bot doesn't work

Hi,

I created a Gmail bot that should trigger when I add a label to an email

But nothing happens, I don’t understand. I looked at the monitor page, it is empty. Nothing is triggered

Surely it can’t be that complicated?

Hello @eric_niedergang

Since AppSheet’s automation system relies on your Google account’s access, the most likely culprit is either the Service Account or the API Scopes.

1. Check the Automation Event (The Trigger)

First, verify how you defined the trigger in your AppSheet Automation (or associated Google Cloud Workflow).

  • Ensure the event is correctly specified: The trigger for a new email label should typically be an External Event or a Webhook that is set up to monitor Gmail changes (usually via the Gmail API, which uses Google Cloud Pub/Sub under the hood).

  • Trigger Type: If you are using AppSheet Automation, your automation must use an “App event” or “External Service” trigger type, depending on how you linked Gmail. Make sure the trigger condition is simple (e.g., [Label Name] = "YourLabel" if it’s reading a Sheet log, or configured to fire directly from the Gmail API webhook).

2. Verify Google Cloud Permissions (The Crucial Step)

If your bot is not triggering, it’s highly likely the necessary permissions (scopes) were not granted, or the service account that runs the automation doesn’t have access to your mailbox.

  • Service Account Access: If your AppSheet automation uses a Service Account (required for complex Google integrations), that service account needs explicit, delegated authority to access your mailbox. This is usually configured in the Google Workspace Admin console under Domain-wide Delegation.

    • Action: Confirm the Service Account ID has been granted the necessary Gmail API Scope (e.g., https://mail.google.com/ or https://www.googleapis.com/auth/gmail.modify).
  • User Consent (If not using Service Account): If you are running the bot under your own user credentials, you might need to re-authorize AppSheet/the connected service to ensure the Gmail scopes were accepted.

3. The “Monitor Page” is Empty

The empty monitor page tells you that the trigger is not even firing, meaning the external system (Gmail API/PubSub) is not notifying AppSheet.

  • Pub/Sub Check (If Applicable): If you set up the Gmail API to publish messages to a Google Cloud Pub/Sub topic, you need to verify:

    1. The Pub/Sub topic exists.

    2. The Gmail API is successfully sending notifications to that topic (this is often called a “Watch” request).

    3. Your AppSheet automation is correctly subscribed to that Pub/Sub topic.

Action: Try creating and applying the label to an email manually. If the monitor stays empty, you must revisit the permissions and the initial connection setup between your automation platform and the Gmail API’s notification system.

I hope it helps!

3 Likes

I just ran a series of tests in Appsheet.

The bot that wasn’t working was a copy of an earlier bot (in which I had already configured permissions for Gmail). That first bot was desactivated

I just deactivated the bot that wasn’t working and reactivated my first bot

AND it works

=> I get the impression that if you duplicate a bot with a Gmail trigger, it doesn’t work?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.