Display button that call bot automation as primary button on list screen

Hi!

I’ve successfully created some functions in Google Apps Script and could linked it into AppSheet via some call from Automation Bot.

Although a bot could be called automatically through some triggers and I could do it myself by setting some data triggers.

However, is there a way that I could call it directly by click a button on screen? Or at least I could create a table for system parameter that includes flags for calling different bots in each column but somehow flag setting is displayed as primary buttons (big buttons) on a specific screen?

I was able to displayed action that call bot (then my script) as Inline button at main screen (and also as Primary button at detail screen) but what I want is display a primary button a main screen (list screen).

My idea flow is that:

  1. At main screen A, display a primary button (1) for adding data via screen (already done through “Go to another view within this app” action) and another primary button (2) for adding data via scripts (which is what I want to do and still struggling now)
  2. When click button (2), my external Google Apps Script function is called (directly or through bot is OK)

Hope I could receive some good advices.

1 Like

Triggering Google Apps Script via AppSheet Primary Buttons

Hello,

It’s excellent that you’ve successfully connected your Google Apps Script functions using an AppSheet Automation Bot. You are correctly looking for a direct, user-initiated way to trigger this Bot using an on-screen button.

The functionality you’re describing is fully supported and is implemented by chaining an Action to your Automation Bot:

1. Create an Action for the Script Trigger: Define a new Action within your app (e.g., “Run Custom Script”). This action’s primary job is to call your existing Automation Bot/Process.

2. Make it a Primary Button: In the Appearance settings for this new Action, set its Prominence to “Prominent.” This tells AppSheet to display it as a large, primary button on the view you attach it to (e.g., your main screen, View A).

3. Implement Your Flow:

Primary Button (1) should be an Action that uses the standard “go to another view” action type to lead users to your AppSheet form.

Primary Button (2) should be the new Action you created in step 1, which will execute your Bot and call the external Apps Script function.

By setting both custom actions to “Prominent” on View A, you will create two distinct, user-friendly Primary Buttons that allow users to choose between the standard data entry and the script-based entry.

This method gives you the direct, user-driven execution flow you were hoping for.

Dear Cr7Ranmati,

Thanks for you answer but could you please tell me more detail on how to set the Primary button (2) to execute the Bot directly?

There has a list of [Do this] options in button’s action setting but I don’t know what is suitable option to solve my requirement.

I heard that I could run the script directly without Bot using “External: go to external” option with a doPost/doGet but I want to run it via Bot so I could control it more. (Also running script via Bot is more secure in my understanding).

@Evendo, this post is entirely wrong.

1 Like

Thanks for kindly let me know, Steve.

I’ve made a reroute: Primary button on List screen → Form view (with only Virtual column with [Show] type displayed as a confirm message) → Action to set trigger data and call Bot when [Save] button is clicked → Bot process that calling Google Apps Script

However, I hope there could be a better solution (a more direct way, such as: Button → Action to set trigger data and call Bot when [Save] button is clicked → Bot process that calling Google Apps Script)

As far as I know, there has no direct way to call Bot from a button without any trigger setting (as in: Button → Bot process that calling Google Apps Script)

1 Like

The way you did it is, in fact, the correct and only way to do it: you have to make a data change that will trigger the bot when the next sync occurs.

2 Likes

Can you provide me the information if this is wrong

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