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

 

 

View solution in original post

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

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,408)