Triggering an API with Button Action

Hi,

I’d like to trigger an AppScript when the user pressed a button. Is it possible to do it? I can do it indirectly by data change.

I have two tables as “Surveys” and “Questions”. I want the user create a “Survey” then create multiple “Questions” with different format such as text or image. Once it’s done I want them to push a button, it triggers a script, this script creates a Google Form then returns the link and store to the “Survey” table. How can I do it?

Thanks…

To the best of my knowledge, AppSheet does not have the option to directly trigger an AppScript without a data change. The work around is to add a column called Trigger to your table and setting it as a number column. When the action button is pressed, configure it to increase the value in the Trigger column by setting the input as [Trigger] + 1. Then, create a bot to call the AppScript when the data in the Trigger column changes.

For the bot’s condition, use the expression:

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

This ensures the bot only activates when the Trigger column is updated.

5 Likes

I really wouldn’t call this a workaround, this is standard procedure.

Manual automation triggers is a core skill to know how to do. :flexed_biceps:

==============================================

You may find the following example app to be something that you’re interested in. It’s a really advanced app, that uses a lot of crazy configuration things, to allow you to build and collect various different questionnaires, surveys, inspections, whatever you want to call them, all within the same app.

https://youtu.be/U7wNAE_KQcw

Just throwing it out there since the thing you’re doing is literally making forms, which is what this example app was demonstrating how to do.

Hope it helps, happy Apping!

5 Likes