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

Filter Browse Gallery by current user email and gallery item

In my PowerApp screen, I have a Gallery which is connected to a Task List in my SharePoint site. The AssignedTo column is multi select allowing Users and Groups. 

 

I am trying to fetch all items which either are assigned directly to me or to a AD security group where I am a member of. The below code will not work if I am not directly part of the AssignedTo column

 

Filter(MyTaskList, User().Email in AssignedTo.Email)

 

Any help would be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter Browse Gallery by current user email and gallery item

Hi @sharepointguy ,

 

Currently I don't find one directly formula expreesion to achieve that.

And there is one alternative method,firstly you need to build the current user and the Group's relation list and then filter.

I test as next,

Button.OnSelect=ClearCollect(UserGroup,{User:User().Email,Group:"My Group Name"}) 

20190516UserGroupRelation.PNG

#Of cource you can use other ways to build their relation list, can be one SP list or excel and so on.

And then in the Gallery Items:

Filter('20190516FilterCurrentUser', "My Group Name" in 'Assigned To'.DisplayName||User().Email in 'Assigned To'.Email)             #('20190516FilterCurrentUser' is my SP Task list Name, you can change to yours on your side)

20190516FilterUserInGroup.PNG

 

If there is one better solution on your side,welcome to update here ASAP.

 

And there is one case for reference:

https://powerusers.microsoft.com/t5/General-Discussion/Filter-on-Outlook-groups-that-the-user-belong...

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

 

1 REPLY 1
Community Support Team
Community Support Team

Re: Filter Browse Gallery by current user email and gallery item

Hi @sharepointguy ,

 

Currently I don't find one directly formula expreesion to achieve that.

And there is one alternative method,firstly you need to build the current user and the Group's relation list and then filter.

I test as next,

Button.OnSelect=ClearCollect(UserGroup,{User:User().Email,Group:"My Group Name"}) 

20190516UserGroupRelation.PNG

#Of cource you can use other ways to build their relation list, can be one SP list or excel and so on.

And then in the Gallery Items:

Filter('20190516FilterCurrentUser', "My Group Name" in 'Assigned To'.DisplayName||User().Email in 'Assigned To'.Email)             #('20190516FilterCurrentUser' is my SP Task list Name, you can change to yours on your side)

20190516FilterUserInGroup.PNG

 

If there is one better solution on your side,welcome to update here ASAP.

 

And there is one case for reference:

https://powerusers.microsoft.com/t5/General-Discussion/Filter-on-Outlook-groups-that-the-user-belong...

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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!

Users Online
Currently online: 88 members 4,376 guests
Please welcome our newest community members: