I'm building an AppSheet app where users can select a Client from the Clients table, and I need to update a field(selected_client) in the Users table to store the selected client for the logged-in user.
Here's what I'm trying to achieve:
When a user clicks on a client in the Clients table, the selected_client column in the Users table should be updated with the client's name.
The update should only affect the row where [Email] = USEREMAIL() (so each user has their own selected client).
Every time a new client is selected, it should overwrite the previous selection.
My main goal is to have a app with a navigation structure like this:
Client Selection → 1.0 Menu → 1.1 Submenu KPI Framework → 1.1.1 KPI Framework
I have a table called KPI Framework, which contains a column Cliente that identifies the associated client for each KPI and I need to display only the KPI data where Cliente = the previously selected client.
Any guidance would be appreciated! Thanks in advance.
In general, you could do the needful with reference actions
1. When the client is selected in the Client table, you could use event of "row selected " to include the reference action stated in the point 2 below as an event action.
Run actions based on view events - AppSheet Help
2) Define a reference action that runs as an event action when the Client record is selected and updates the column in the Users table for the logged in user using USEREMAIL()= [Email]
The sample app about reference actions from the help article Get started by using the sample apps - AppSheet Help is given below
User | Count |
---|---|
16 | |
11 | |
7 | |
3 | |
2 |