Right now, every entry in Primary navigation and Menu navigation must point directly to a View. There’s no way to make a navigation item run an Action first and let that Action decide where to go. Actions can currently only be triggered by an explicit button tap or by a view event (Row Selected, Form Saved), never by tapping a navigation entry itself.
This makes a very common pattern, conditional navigation, much harder to build than it should be. For example: “if the current user already has a record in this table, take them to its detail view; if not, take them to a blank add form.” Today, achieving this requires building a workaround: creating a separate table just to represent menu items, adding a Gallery view over it, and attaching the conditional logic to the Gallery’s Row Selected event, just to get a single tap to run an Action.
Use case (from our project):
We have a couple of tables where each user should have exactly one row (a personal preferences record). We want a single menu entry that, when tapped, checks whether the current user’s row already exists and routes them to the right view (edit existing vs create new) automatically. Since navigation items can’t run Actions directly, we had to build an entire secondary “Menu” table and Gallery view as a workaround, purely to get this one behavior.
Requested feature:
Allow a Primary navigation or Menu navigation entry to be configured to run an Action on tap (the same way a Gallery/Deck/Table row’s “Row Selected” event can run an Action), instead of only being able to point to a static View.
Workaround: Build a separate table representing menu entries, display it as a Gallery view, and attach the conditional navigation logic to the Gallery’s Row Selected event. Functional, but adds an extra table and view purely to route one tap.
Yes, having this capability would be a nice feature.
Early on, AppSheet built the platform as a data-driven event-based system. This means all activity, whether it be user interactions or events, are driven based on the context of the data from which they originate and are almost always based on the user interacting with that data - the only exception being Scheduled automations.
Having actions at the top level breaks that design - there is no data context from which to base the event. It doesn’t mean it couldn’t have been added but does mean that the underlying implementation would have been much more complicated.
A compromise in app design is needed but fortunately there are usually multiple ways to achieve the same results.
I am a little confused by this comment with regards to your suggested feature. Is it because you don’t want to show the table? If so, why not?
Thanks for the follow up, let me clarify the scenario a bit more since I think the confusion is about why we do not just want to show the table.
The Preferences table has exactly one row per user, by design. So functionally there are two very different states for a given user. Either their row does not exist yet, in which case the right experience is a blank form to create it. Or their row already exists, in which case a Deck or Gallery view showing “their one row” does not add any value, the user just wants to land directly on that row’s detail or edit view and start working. Showing a list view with a single item in it is an extra tap and a confusing UX, since the user never has a real choice to make between multiple rows. It reads like a bug rather than a designed screen.
So it is not that we do not want to show the table at all, it is that the table itself is not a useful destination in either state. In the no row case, a list view of zero items is not useful, we want the Add form. In the one row case, a list view of one item is not useful either, we want the Detail view for that row directly. The Gallery is not really “the destination”, it is only a place to hang a Row Selected event so we can run our conditional Action, which is exactly the workaround described in the original post.
I agree this specific case can be solved other ways, and probably is a narrow example on its own. But the underlying gap is broader: any time a menu tap needs to decide the destination based on something about the current user or current data (does a row exist, what status is it in, what role does this person have) rather than always landing on the same static view, you end up needing this same workaround. A menu entry that can trigger an Action, the same way Row Selected can, would cover all of these cases without needing a dummy table and view purely for routing logic.
Happy to add a couple more concrete scenarios if that helps make the case, let me think on it.
You are wrong to think there is a need to show the table in either case.
Your table, with at most one row per user, should have a security filter to omit rows of other users entirely.
If you care to acknowledge the possibility the table might still have more than one row–which is possible in some cases–add a slice on top of the table to enforce exactly one row.
Create a form view on the slice or table with a Show if expression like ISBLANK(My Slice[_ROWNUMBER]). The view is only visible if the user has no row.
Create a detail view on the slice or table with a Show if expression like ISNOTBLANK(My Slice[_ROWNUMBER]). The view is only visible if the user does have a row.
Thanks everyone for the input on this thread, wanted to close the loop and also clarify where I think the mismatch in understanding happened, since it might help explain why the suggestions here did not quite match what we needed.
The core problem was not actually about whether to show the table or not. It was about the fact that a navigation item can only ever point to a static view, so any destination that depends on the current state of the data, whether a row exists, what status it is in, what role the user has, has to be decided somewhere else first. The two view Show if approach that Steve suggested is a real and useful pattern, and I want to be clear it does work for the narrow case of choosing between two already defined static views based on a boolean condition on the data. But it does not solve the more general request in the original post, which was letting a navigation tap actually run an action, with whatever logic or side effects that action contains, rather than just picking between two views that already exist. Those are two different capabilities that happen to overlap in this one specific scenario, and I think that overlap is what caused the suggestions to feel like a full answer when they only covered part of it.
In our case we ended up not needing either the Show if pattern or the action on tap feature, because we changed where the problem was solved. Instead of deciding at navigation time whether the user already has a Preferences row, we now guarantee the row exists before the user ever opens the app. When an admin creates a new user account, an automation bot fires on that creation event and creates the Preferences row immediately. Since the row is always there by the time the menu entry is tapped, we can point it straight at the detail view with no conditional logic at all.
So to summarize for anyone finding this thread later. If your destination only ever depends on a simple boolean you can express as a formula, Steve’s Show if pattern is the right tool and works well. If your destination depends on something you can guarantee ahead of time through an automation, our approach of creating the data proactively removes the need for conditional navigation entirely. And if neither applies, meaning the destination genuinely has to be computed dynamically at tap time based on something you cannot pre resolve, the original feature request of letting a navigation item run an action still stands as a real gap in the platform.
Thanks again to WillowMobileSys and Steve for taking the time to think through this with me.
There is one other important design element to consider with this statement and I only mention it for your future implementation considerations.
Your User Preferences table is likely in a non-normal form. Meaning you have various columns for different preference settings. When you need to add a NEW preference setting, it would require adding a column, regenerating the table and then implementing the usage of that column in needed places around the app. The app then requires a deployment and a user update to obtain the NEW functionality.
AppSheet was built very much around the idea of normalized tables. In this design paradigm, the potentially varying data is inserted as rows rather than dedicated columns. And if the feature was built well, no changes would be needed to the table and app implementation changes would not be required either - (except for new attributes).
What this would have meant in the case of the User Preferences table is that each user would have had a LIST of settings - a row for each individual preference in the table view. Each being individually added, deleted and adjusted.
Why is the non-normal form important to recognize?
Adding tables in a non-normal form for more involved functionalities can quickly become difficult to deal with and inefficient in an app. The non-normal form table, in many instances, require the App Creator to iterate over the COLUMNS of a table and AppSheet does NOT have functions to handle that. Workarounds are required and expressions become large, complicated and slow.
Recognizing the non-normal table form and avoiding it can save you aggravation as you build out the app. Normalizing tables from the start results in easier to build apps and will pay dividends in app maintenance ease and efficiency in the future.
Thanks, that is a useful point to keep in mind. In our case the Preferences table already works on a per row basis, each user has their own row for their settings, not a column based structure. What we needed was just routing between a Deck view and a Detail view depending on whether the user already had a row, and that need went away once we set up automatic row creation for every user. Still, good to have the normalization point raised for anyone reading this thread later.