USEREMAIL ROL BASE PERMISSION

I want that if the [Date] is equal to the current date, then the delete icon should be shown to my users. But the admin should always show the delete icon. 

This time I'm using this function but not effectible. I want delete icon show on user and admin base.

UYUI.PNG

Capture.PNG

0 7 111
7 REPLIES 7

I would recommend implementing the CurrentUser slice suggested to you in one of your other posts.  It will help simplify your app and increase efficiency for these kind of lookups - which you will find you are going to need all over your app.

Without CurrentUser, the expression you want is:

AND(
    ANY(SELECT(User Login[User Control], [Email] = USEREMAIL())) = "Admin",
    [Date] = TODAY()

 To contrast, if you did implement the CurrentUser slice, the expression would simplify to that below.  But since CurrentUser will only ever have a single row, it will be much more efficient - especially if you app grows to have many. many users.

AND(
    ANY(CurrentUser[User Control]) = "Admin",
    [Date] = TODAY()

 Other post with suggestion:

https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Admin-and-Users-permission/m-p/405514#M159167

 

This function is working AND(
ANY(SELECT(User Login[User Control], [Email] = USEREMAIL())) = "Admin",
[Date] = TODAY()
)

But one issue. I want the admin to see the delete icon always. But it is visible to the user only when the date is equal to the current date. 

Sorry.  It should have been OR not AND:

OR(
ANY(SELECT(User Login[User Control], [Email] = USEREMAIL())) = "Admin",
[Date] = TODAY()
)

Hi @WillowMobileSys 

You are trying your best to help. But let me tell you that this function is not successful.

Based on what you provided above, it should work...provided your users login with the Email address you have listed in your User Login table.  Can you explain how its not successful?  What happens or doesn't happen?

you can use if and select function with these parameters,

if(
and(count(SELECT(User Login[User Control], and([Email]=USEREMAIL(),[User Control]="Admin"),true))>0,[Date]=Today()),
true,
if(
and(count(SELECT(User Login[User Control], and([Email]=USEREMAIL(),[User Control]="User"),true))>0,[Date]=Today()),
true,
false
)
)

 

I used this function. But this function is showing icon only on current date. But the delete icon is not showing on the rest of the date. Be it admin or users. 

When the current date is equal to the date the user should see the delete icon. And the icon should always be visible to the admin. 

 

Top Labels in this Space