cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sharepointguy
Helper I
Helper I

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
v-yuxima-msft
Community Support
Community Support

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
v-yuxima-msft
Community Support
Community Support

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,277)