cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,469)