cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KReyes
Level: Powered On

Filter a table by multiple users

Hello,

 

I currently have an app that is filtered by user, most of them are directors or managers. Now, I have been asked, to find a way for their assistants to be able to see what their director or manager sees on the app. Is there maybe a formula that could check the user email against one column (DirectorEmail) if not match, then check another column (AssistantEmail)? 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Filter a table by multiple users

Hi @KReyes,

 

Do you want the Dirctor User can see Director Email Column and Assistant User can only see Assistant Email in the App? Or the Director User can see both?

What data source do you use?

I test by SP as data source and use if  function to achieve what you described the requirements.

 

I think you can try the following workaround.

I test as Next:

Data Source:20190205FilterByUserEmai( My SP list name)

20190205multipleusers1.png

App Test:

 

Add one Gallery, and its layout is Title,Subtile,Body.

Subtitle6.Visible: If(User().Email in '20190205FilterByUserEmail'.DirectorEmail,true,false)    (can only see DirectorEmail)

Body3.Visible: If(User().Email in '20190205FilterByUserEmail'.AssistantEmail,true,false)       (can only see AssistantEmail)

Or

Body3.Visible: If(User().Email in '20190205FilterByUserEmail'.DirectorEmail,true,If(User().Email in '20190205FilterByUserEmail'.AssistantEmail,true,false))  (Director can see both Email Columns)

 20190205multipleusers2.jpg

 

Hope this can be helpful.

Best Regards.

Yumia

 

emh
Level: Powered On

Re: Filter a table by multiple users

 

This result may be achieved with a nested If statement. Assuming you are using a SQL table to store credentials. The Context Variable, AllowAccess, is one way to signal the program that the user is authorized.

 

If(!IsBlank, Lookup(dbo.MasterTable, DirectorEmail=User().Email), UpdateContext({AllowAccess:true}), If(!IsBlank, Lookup(dbo.MasterTable, AssistantEmail=User().Email), UpdateContext({AllowAccess:true}), UpdateContext({AllowAccess:false})))