Behavior actions based on user role

I am having a hard time setting Editable_If permissions based on user role in my app. Hopefully someone can lead me to the correct formula. 

I am making a real estate app and I am trying to restrict an Edit behavior only to admin AND the user that published the property listing in the app. I think my issue stems from the "Listing Agent" label in the property profile is a REF_Row to my Agents table where the agent's name, email, etc is listed.

Using the expression =IN(USEREMAIL(), SELECT(Agents[Email], [role]="Admin")) allowed me to only have admins edit the property listings, but I am missing the ability to have the user who is the "Listing Agent" also be able to edit their property post. 

Any suggestions?

0 6 97
6 REPLIES 6

IMG_20230205_225524.jpg

โ€ƒ

Hi! Thank you for your quick reply. I don't understand what you mean with your picture and how it relates to my issue. I am pretty sure I need to use some form of an expression. Are you able to explain? 

What you're asking is you'll give permission the other user's to modify your app, right? Check in the user mgt, you can assign anyone from your user lists to edit the definition of your app.

What I am actually looking for is to only let the user edit THEIR property listings and not another users listing. So all users can edit, I just want them restricted to editing their own property listings and not another persons.

In addition, I would like admins also to be able to edit everyone's property listings. So I need an expression that restricts the editing behavior to that user (Listing Agent - a name that is referenced from my agents profile) AND admins.

Any suggestions?

So far this is the method I followed ๐Ÿ‘‡

https://support.google.com/appsheet/answer/10104977?hl=en


@mklein wrote:

IN(USEREMAIL(), SELECT(Agents[Email], [role]="Admin"))


You need to incorporate into your expression a reference to the email of "the user that published the property listing in the app". Without knowing the specifics of your tables and columns, here are some general patterns that might be applicable.

IN(USEREMAIL(), SELECT(Agents[Email], OR([role]="Admin", [Email] = USEREMAIL()))

IN(USEREMAIL(), SELECT(Agents[Email], [role]="Admin") + LIST({expression that returns the email of "the user that published the property listing in the app"}))

OR(IN(USEREMAIL(), SELECT(Agents[Email], [role]="Admin")), USEREMAIL() = {expression that returns the email of "the user that published the property listing in the app"})

In case it's helpful, there's lots of guidance on related topics linked from SUMMARY TIP: User permissions, roles, and settings - Google Cloud Community

Top Labels in this Space