User can only update their directory info

I have a staff directory in my app that is available to all users that I want to keep read only. I’d like to make it so a staff member can update their own info (like their cell number, etc). I set up a slice based on their email field and set up a UX so it pulls up just their info. This is all working so far. I tried to toggle “Updates” on for the slice, but it won’t stay on when I save. I’m guessing I might need an expression in the original staff directory table to allow updates based on their login (email). I have read several posts and articles on expressions for allowing edit access for users, but can’t find one that addresses this specific issue.

Any assistance would be appreciated.

0 5 125
5 REPLIES 5

Is your table on read only in the table tab?

Hi, June. Yes, the table is read only so that users can’t edit each others’ data. I’m assuming that’s why I can’t change the slice. So, I’m wondering if there is a specific expression I should be using on the table or if there is some other work around.

Here’s another idea.

As I understand your use case, you wish each user to see all staff entries but be allowed to edit only their specific row.

I believe AppSheet provides only table level editing capabilities so, out of the box, you wouldn’t be able to open just a single row for a user to edit.

You’ll need a creative solution. Here is how I would accomplish this:

  1. Keep the table as editable.
  2. Disable the Editing capabilities by:
    a) Removing the Add button on the table
    b) Any row selection activity goes only to a detail view.
    c) Remove the Edit button on the Detail view.
  3. Create an Inline Action that navigates to the Form of the staff table (for editing).
  4. Add a column into the Staff table that shows the Inline Action.
  5. Attach the Inline action to the table column.
  6. Adjust the Behavior criteria of the action so it shows ONLY for the row of the logged in user.

The end result is that you will have a small extra column in the Staff table to show the Inline Edit icon but that icon/button only shows on the row for the logged in user.

If you have admins that need access to all records, then adjust the Add and Edit buttons so they only show for admins.

So, I figured out a work around. I enabled updates the original directory table. I then made a slice of the whole dataset and made the slice read only. I then made the UX of the full directory based on the read only slice.
So, now everyone can see the full directory in read only mode, but each person can access a separate UX to update their own info, if needed.
If there is a fancier way to do that, I’d be interested to hear, but this is working perfectly as outlined above.

John, thanks for this idea. I would have never thought to approach it this way! I can think of a few other applications for this approach in this and other projects.

Top Labels in this Space