Button to trigger an email bot

Looking back at threads it looks like it isn't possible to have a button that sends an email without changing something on the sheet and this was made a feature request. Has anything been done on it?

What I really need is something the user can press from anywhere in the App that just triggers the email to send the document.

 

thanks

James

0 18 477
18 REPLIES 18

Steve
Platinum 4
Platinum 4

@JamesWB wrote:

Has anything been done on it?


Nope.

Aurelien
Google Developer Expert
Google Developer Expert

Hi @JamesWB 

 

You may want to create a new Sheets/Table: "BUTTON"

one row, 2 columns: key, value

Create an action: "increaseButtonValue". 

Do this: "Data: set the values of some columns in this row"

Set this columns: "value" with:

[value]+1

 

Then, your "anywhere action":

Do this: "Data:execute an action on a set of rows"

Referenced table: "BUTTON"

Referenced Action:"increaseButtonValue"

And your bot will be triggered according to your button value.

 

You can copy this action to any table required ๐Ÿ™‚

Interesting solution, thanks. How would you do that to generate data from another sub-sheet? I have a table called Machine and a related table Hazard that have the data to put in the template. Normally a field change inside Machine (PrintDoc - either set to Yes or No) populates the template. But this is tedious because Machine is a very large set of columns divided into more than 20 tabs and you have to keep going Next-Next-Next until you reach the Save button to trigger the PrintDoc action.

Hi, I don't understand this part of your answer:

"Then, your "anywhere action":

Do this: "Data:execute an action on a set of rows"

Referenced table: "BUTTON"

Referenced Action:"increaseButtonValue"

And your bot will be triggered according to your button value."

How do you create an 'anywhere action'? And how do you generate a button for it?

 

thanks.

 

Hi @JamesWB 

By anywhere action, I meant "on each table from where you wish to trigger your bot".

This means that you will create a new action, and set its table where you wish to see it.

You can call it "sendEmail". 

To do so:

Behavior/Actions/New Action

OK, I don't get it. It seems like it's not going to work but I don't understand how the actions work really.

The process I want to follow is that the user can press a button and then select a given Machine from the Machines table and then click to Send Email. It will then print the templated document, which calls data from several related tables as well.

What would I put in Referenced Rows?

 

JamesWB_0-1646325470003.png

 


@JamesWB wrote:

The process I want to follow is that the user can press a button and then select a given Machine from the Machines table and then click to Send Email. It will then print the templated document, which calls data from several related tables as well.

What would I put in Referenced Rows?


Well, in that case, you don't need a "Button to trigger an email bot"

You would just need to add a new row to another table and the bot should trigger when a new row is added to that one.

I have made a lot of this scenarios

To "call data from several related tables" you need to make sure that the tables are reachable from the new one that you will need to trigger the bot.

Arguably you can make expressions like Table[Column], Select() or Filter() on your template in order to reach any one you want, but that will need at least some proficiency on AppSheet expressions.

As always, read as much of the documentation as you can

I've already got a column that has two values - Yes and No - PrintDoc. It works fine in triggering the email, but it requires a Save which is a problem because you have to click through 20 tabs to reach Save.

The documentation is hopeless, it only gives very vague and simplistic examples and not real world implementations.

Let get what @Steve have to say about it...

Nah, just kidding.

It's good at giving you the principles and even some real world scenarios made by Steve, but workarounds are workarounds, are ideas and tips made by experience using the platform

The problem appears to be your expectation that a solution for your particular problem will be handed to you. It won't, so you've got to figure it out.

I'm sorry if I come across badly, I have put a lot of work into trying to make it work, reading the documentation, watching the vids, etc. Thanks for any help offered so far to everyone.

 

Here is a good post talking about this as a workaround:

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Trigger-Workflow-With-A-Simple-Action-Button/m-p...

BTW, don't be offended, but I just discovered that posting a lot can make you a "Participant V" really quick

Laughably complicated for something that should be built natively and simply into any serious app builder.


@JamesWB wrote:

Laughably complicated


Not really for someone that's used to make this kind of workarounds.

Although I know that AppSheet is not as well integrated to the device as we would want. For example, we don't have notifications, sounds, print buttons, copy to clipboard, etc.

Aurelien
Google Developer Expert
Google Developer Expert

This could be simple, but you said: "What I really need is something the user can press from anywhere in the App that just triggers the email to send the document." ๐Ÿ™‚

The important word here is "anywhere" ๐Ÿ˜‰

 

Basically, from your screenshot, I assume you don't need that to be anywhere but just related to your machine.

I assume you need to send an email that will provide information about this specific machine.

I agree that sending an email should be easier, but it comes with a bot and bots need various components that you need to define.

 

Let's start with this one then.

Here is my suggestion:

1)Panel Automation/Tasks: Create a task and name it "Task send an email".

Disable "Use default content?".

On "Email Body Template", click on the button "Create"

2) Panel Automation/Processes: Create a process and name it "Process Send an email"

Add a step : name it "Step send an email", pick in the list: "Run a task", and pick the task you just made "Task send an email"

3) Panel Automation/Events: Create your event and name it "when triggered"

Pick "Data Change", "Updates Only"

Table:Machine

Condition:

[_THISROW_BEFORE].[Trigger]<>[_THISROW_AFTER].[Trigger]

4) Panel Automation/Bots: Create your bot and name it "when triggered, send an email"

Choose the event and process you just made

 

5) Panel Behavior/Actions: Create an action and name it "Trigger the email"

For a record of this table : Machine

Do this:Data:set the values of some columns in this row

Set these columns: Trigger==> [Trigger]+1

 

6) Let's try it

 

For reference:

https://help.appsheet.com/en/articles/5300790-sending-an-email-from-a-bot

 

 

Would this result in a button you can click and avoid the Save action? It sounds similar to the PrintDoc button I already have embedded in the Table which requires Save to trigger.

Top Labels in this Space