Dynamic Add/Edit permissions based on virtual reference columns in Table Detail View

@Steve

From our message…
"I have a table with a list of places (and info about each place) we will call Table 1. The list of places in Table 1 we will call A, B, C and D. I then have several other tables that are used as different types of forms to fill out when personnel are at each location (let’s call one of these forms Table 2). These are linked via a Ref column to Table 1 based on the location names A, B, C or D. I then have a view based on Table 1 which is just a list showing A, B, C and D. When you click on A, you see inline views of Table 2, as well as inline views of other Tables I use as different types of forms related to that location. My goal is that when users click on A or B and see the inline view of the associated Table 2 rows, they will have the ability to view these rows, but not edit them or add new ones. However, when they click on C or D, they should be able to both edit and add new rows.

Changing the system add action did not remove it from the inline detail. It sounds like I could write expressions into every column’s “editable if” so that if the user adds a row to A or B they won’t be able to input anything, though this does not stop them from initially clicking “add” to begin filling out the form.
I attempted this in the table’s Edit action - NOT(OR([Name]=“A”, [Name]=“B”)) but it did not work. I feel like I need to put this same expression into the virtual reference column of Table 1 but that does not seem to be an option."

2 7 758
7 REPLIES 7

Steve
Platinum 5
Platinum 5

If I understand your goal, I think you might approach it like this:

  1. Create a read-only slice for each table (e.g., A & B) that the user should not be able to update.

  2. Configure the Source table of the Ref columns that refer to those should-be read-only tables to point to the corresponding read-only slice, rather than to the table directly.

    3X_b_e_bebf2a2cc3106c5429037eb4f307a90780d3253c.png

My Source table in this situation can be read-only so that should work. Thanks for the creative solution! I will give it a try.

You’re correct; if you want to completely hide this button, then you’ll need to hide the action - then it will go away.


Creating a slice to handle user-specific permission

This is one way of limiting permissions, but it’s going to bring with it the necessity of handling slice-specific views, and other bits you’ll have to handle later.

Instead of creating a slice to handle the permissions, instead simply adjust the condition for when the individual actions should be shown.

If you want to control the “Add” permission for a table:

  • go to Behavior>Actions
  • find the “Add” action for the table you’re wanting to control add permissions for
  • apply your conditional format inside the Condition space for the action.

To control the Add permissions: modify the “Add” action
To control the Delete permissions: modify the “Delete” action
To control the Edit permissions: modify the “Edit” action


It sounds to me @Shaun_Stringer that what you need to add into your app is a way for the app to know who’s using the app.

If you create a Current_User slice (with a formula of USEREMAIL() = [User_Login_Email] ) then you can easily pull data from that and use it for permissions like this.

Then on your corresponding actions you can use a formula something like this:

INDEX(Current_User[User_Role], 1) = "Admin"

Sir On adding the condition in the behavior tab on Add Action It won't show in the table deck dashboard card etc. views but it shows in the form view where the Value is set to the Ref to this table.

This Method not Working.

And there is one major problem If someone edit the url and add table=tablename and view=form he is able to add new row. 

what is hell.

Please start a new topic for help with this.

Or…

another way would be to put a formula inside the actual table permissions:


Creating a slice was the best method before we had granular control over things in other places.

Thanks for the additional solutions. I will play around with them and see what works best for my situation.

Top Labels in this Space