Shared and private DB

Hi guys,

in my app I would like to share a table to everyone, a complete DB of product.

The other table is private, related to each specific users (the private list of orders).

It is not clear to me how to set up che 2 tables making the first one available for view to everyone and the second one dedicated.

Thanks much

fabrizio

0 2 64
2 REPLIES 2

In AppSheet, the problem is not who can view which tables,  instead think of this as what rows are loaded into the app for the user.

On your "private" table you would implement a Security Filter expression (Security Filters: The Essentials).  Security Filters are applied on the server and only allow through to the device the specified rows.

To illustrate this, let's say on your Order table you have a Created By column and insert the login email of the person creating the Order.  On your "private" table you could create a Security Filter like:

USEREMAIL() = [Created By]

Only the Order rows  created by the logged in user will download into the app.

CAUTION:  Assigning login email to the Created By column was just for illustration purposes.  I do not recommend using the login email.  Users can and do change their email addresses occasionally.  If that happens then you have no way to identify who the older rows, of this same person, belong to.  Instead I recommend creating a Users table where the login email is recorded and the Created By column is assigned the ID of the user from that Users table.  If the email changes, you can update it with no impact to the data structure.

Steve
Platinum 4
Platinum 4
Top Labels in this Space