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 8

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})))

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 28 members 3,863 guests
Please welcome our newest community members: