Tip: How to Create a Primary Action Button in Table, Deck, or Other Views in AppSheet
As of now, AppSheet does not natively support primary action buttons in table or deck views. I’ve already submitted a feature request, but until it arrives, we’ll have to get a bit creative… okay, a bit hacky too .
This tip can be adapted to any use case, but the example we’ll use is: generating a PDF containing data from child records, selectively triggered from a button in the parent table. The trick lies in creating an intermediate form that acts as the launcher of an automated process.
? General Structure of the Algorithm
-
From the parent table, the user taps a primary action button.
-
This button opens a form based on a minimalist slice of the same parent table.
-
The form includes an
EnumList
field (base type Ref), where the user selects the parent records whose child records will be processed. -
When the form is saved, a temporary helper row is created.
-
A Bot detects this row and launches a chain of actions.
-
Actions are executed on the selected child records.
-
Finally, the helper row is deleted.
Step by Step
? DATABASE STRUCTURE
1. Add two new columns to the Parent Table
- [action_confirm]
[details=Show More]
- Type: Yes/No
- Reset on edit: ON
- Initial value: IF(CONTEXT(“View”) = “slice_form”, true, false)
[/details]- [parents]
Show More
- Type: EnumList base type Ref to the parent table
- Required: Yes
- Suggested values / Valid if: Table[ID] – or any subset you prefer
- Initial value: Table[ID] – or any subset you prefer
2. Create a Slice from the Parent Table
Show More
This slice will be the source for the form view. It must allow adding records, and include at least these columns:
-
[RowNumber]
-
[ID]
-
[parents]
3. Create a Form View Based on This Slice
Make sure only the [parents] field is visible (unless you want to show others).
Position: Ref
Event Actions - Auto assign: Go Back
4. Create the Action to Launch the Form
Show More
-
Type: Go to another view within this app
-
Formula: LINKTOVIEW(“items_slice_form”)
-
Position: Primary
This action will appear as a primary button in table or deck views.
Automation with Bots
5. Create a New Bot on the Parent Table
[details=Show More]
-
Event: App data change (Adds or updates)
-
Condition:
[action_confirm] = true
[/details]### Bot Processes on the Parent Table
6. Add a Process to the Bot: Action on a Set of Child Rows
[details=Show More]
-
Table: Parent
-
Action type: Execute an action on a set of rows
-
Target table: Child
-
Rows to execute on:
FILTER( "Children_Table", IN([parent_id], [_THISROW].[parents]) )
-
Action to execute: Could be generate PDF, update rows, send emails, WhatsApp, etc.
[/details]### Final Action in the Bot: Delete the Auxiliar Row
[details=Show More]
-
Type: Delete
-
Table: Parent
-
Condition: Leave it blank if this comes after your main process — the record will simply be cleaned up.
[/details]##Important
This auxiliar row is not intended for end-users — it’s a purely internal trigger mechanism.
You can hide it from views or display it in a debug/admin view if needed.
Conclusion
With this method, we can simulate a primary action button that kicks off complex processes like document generation, multi-record updates, batch communications, and more — all without SELECT() and without unstable hacks. Just pure AppSheet logic.
This pattern also sets you up for even more advanced use cases like: sending batch emails or WhatsApp messages, generating grouped reports, flagging records for review, and much more.
The important thing is that you understand that the primary button takes us to a slice-based auxiliary form, and then, when you save, it creates a row in the base, triggers a series of actions, and then deletes the row.
I hope this helps, and I apologize for any previous misunderstandings.