Security view expression

Hey guys!

Ok so I am trying to put together an expression that says these employees on this crew can view a view on the app. I want people both on the admin crew and the maintenance crew to be able to view it.

I have a spreadsheet called Employees. The key is the employee name, but then the other columns are [Useremail], [Crew], etc.

I have other functions on the app that utilize the Employee Name as a ref so I need to keep that as the key. Canโ€™t change the key to Useremail.

So what expression do I use? FILTER? SELECT? Nothing seems to be working. Is it a row ref? Idk. Iโ€™m thinking something like this, but I know itโ€™s not quite thereโ€ฆ

OR((Useremail() = [Useremail].([Crew]= โ€œMaintenanceโ€), (Useremail() = [Useremail].([Crew]= โ€œAdminโ€)

What are your thoughts? Remember, Useremail is not the key in the spreadsheet. I feel like I should use a de-ref somewhere but maybe thatโ€™s not quite right.

Solved Solved
0 8 186
1 ACCEPTED SOLUTION

Try this as the viewโ€™s Show if expression:

ISNOTBLANK(
  FILTER(
    "Employees",
    AND(
      (USEREMAIL() = [Useremail]),
      IN([Crew], {"Admin", "Maintenance"})
    )
  )
)

View solution in original post

8 REPLIES 8

Steve
Platinum 4
Platinum 4

For a security filter or slice? Or a column Show? expression? Or a viewโ€™s Show if setting?

Itโ€™s the security filter for a View

Okay, before going too far here, itโ€™s super important to understand that Show if for a view is NOT a security feature. Show if merely determines whether the view is displayed in the main menu or along the navigation bar at the bottom of the screen. There are still ways for the user to get to the view, and if they get there, they will be able to see its content. Is that what you want?

Umm, I guess not, but Iโ€™m not sure if they would ever get there anyway.

Right now, Iโ€™m not really concerned whether they see things or notโ€ฆitโ€™s more of a convenience thing than anything else. I just donโ€™t want to clog their phones with a million views if we donโ€™t need to, but itโ€™s not a crisis if they do see the information.

So, can you help me with the expression?

Try this as the viewโ€™s Show if expression:

ISNOTBLANK(
  FILTER(
    "Employees",
    AND(
      (USEREMAIL() = [Useremail]),
      IN([Crew], {"Admin", "Maintenance"})
    )
  )
)

Yay Steve! Thank you so much! It worked

Sorry didnโ€™t rope you into the last oneโ€ฆ

View>Display>Show If

Top Labels in this Space