How to send only one email from an action trigger and a bot

I am trying to create an interaction where a user could select a bunch of rows in a table, click an action to send a report, and have only one email sent with report details as a result. I have the action and bot to send the report, and it works great if a user triggers the action (sends the report) from a detail page, but when they try to do the action in bulk (which I can't figure out how to block) it sends many emails instead of just one.

Here's what is working:

  1. I have an action for Send report which writes a NOW() timestamp to a Report trigger column in the row for a single record
  2. I have a bot that looks for non-empty Report trigger fields that have changed (using All Changes and [_THISROW_BEFORE].[Report trigger]<>[_THISROW_AFTER].[Report trigger]
  3. If the bot finds a record that meets the criteria in #2, the bot sends an email.

This sends one email with an expression to include all the rows I want. But if a user instead uses the checkbox icon on a table page of records, and then selects a bunch of records and triggers the action, many emails get sent. I understand why: the bot is looking for any rows that match the criteria. Is there a good way to tell AppSheet "only send one email even if the action is triggered on many records in succession"? If not, I may try to block the action entirely on the table page using a method like this one, but I'd prefer to avoid that if I can.

0 1 83
1 REPLY 1

I had a similar case , what did is as follow: 

 

Filter the rows needed 

Call a http webhook to send it to a temporary table 

Call a http webhook to call an action that would trigger an on update bot by updating a trigger column in the first row of the table 

 

Send email 

 

Delete All 

 

In this way all rows in the table would be included in one email 

You can add a condition to wait for that table to be empty incase several users would be generating a report at the same time

Top Labels in this Space