web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery by memb...
Power Apps
Unanswered

Filter gallery by member of a Office365 Group

(0) ShareShare
ReportReport
Posted on by

Hi there,

 

in a gallery in PowerApps I would like to filter all items by user of a specific Office365 group. Does anyone know how to do that?

 

Thanks in advance

Dorothee

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Can you describe a little more about what you are attempting to do?

    You can use the Office365 Groups connector to get group information.  But, I am not sure the relationship between your gallery and how that relates to the group, or even then the group member.

  • v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to filter items based on a  specific Office365 group?

    Could you tell me

    1)what your data source is 

    2)which column do you want to filter based on the  specific Office365 group? the column's data type?

    3)where does the specific Office365 group comes from? a drop down? the drop down's Items?

    I think you need Office365 Groups connector.

    Using this connector you could get the members if you have one specific Office365 group id.

     

    I've made a similar test for your reference:

    insert a drop down for you choosing a specific group

    insert a gallery to filter based on the members

    1)set drop down's Items:

    Office365Groups.ListOwnedGroupsV3().value

    // list all the groups that I belong to, choose a group

    2)in my test, I have a person field named person_field(not allow multiple person)

    set the gallery's Items:

    Filter(tablename,person_field.Email in 
     Office365Groups.ListGroupMembers(Dropdown1.Selected.id).value.mail)

     // list the group members based on the selection of group, then filter based on this

     

     

    Here's a doc about Office365 Groups connector, which may help you a lot:

    https://docs.microsoft.com/en-us/connectors/office365groups/#listgroupmembers_response

     

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes Let me explain what I am trying to do. I'm not quite sure how to use your advice in my context.

     

    I have a SharePoint list, 'Satasource'. The list items are 'Project Requests' which are filtered by the column 'Workflow Action'. 

     

    What I am trying to do is, that this gallery is only visible to the members of a specific O365 group. However, this group is not mentioned in any column of my datasource. I rather want to verify wether the current user is member of my O365 group and then display the items to him/ her.

     

    Was this a better explanation of my scenario?

     

    Thanks for helping me

    Dorothee

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, much better explanation.  Thank you for the clarification.

    Actually, in that case, the approach that @v-yutliu-msft has provided should give you the results you are looking for.  The objective is to get the list of the members of the Group (with the  ListGroupMembers function) and then use that to condition your Visible property of the Gallery.

    Slightly different in step 2 of @v-yutliu-msft response - instead you would want (again from your description) to set the Visible property on the Gallery to User().Email in Office365Groups.ListGroupMemebers(yourGroupid).value.email)

    (please adjust that formula for your needs)

     

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes Thank you. One last question? How do I use part 1) of @v-yutliu-msft 's description?

     

    My gallery filters items according to a specific status field (dropdown), not the members of the group.

  • Community Power Platform Member Profile Picture
    on at

    @Randy I might add, that the group is not part of my sharepoint list, it is not selected in any dropdown.

    The gallery I have is filtered according to a status dropdown and I want the whole gallery only to be visible to the members of one specific group.

  • v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to make the gallery visible only when current user is in the groups that you belongs to?

    What I posted is just the example about how to use that two functions.

    Because I did not quite understand what you want.

    Now I think I know.

    Try this:

    1)connect with Office365 Groups

    2)set the gallery's Visible:

    If(IsEmpty(
     ForAll(Office365Groups.ListOwnedGroupsV3().value,
    //Office365Groups.ListOwnedGroupsV3().value will list all the groups that you own and belong to
     Filter(Office365Groups.ListGroupMembers(id).value,
    //Office365Groups.ListGroupMembers(id).value will list all the members in the spefic group
     User().Email in mail
     )
     )
     ),
    false,true)
    //if the result is empty then the current user is not in the group that you own and belong to

     

    Best regards,

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Did @v-yutliu-msft response answer your question?

    Or do you need a little more?

     

  • Community Power Platform Member Profile Picture
    on at

    @v-yutliu-msft @RandyHayes 

    Well I am not quite sure. 

     

    I have set the visible property of my screen on: User().Email in 'Office365-Groups'.ListGroupMembers("id").value.mail
    and it seemed to work.

     

    Should be possible, too? Right?

  • v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you mean that you set the screen's Onvisible to :

    User().Email in 'Office365-Groups'.ListGroupMembers("id").value.mail

    Actually, I so not think this will work.

    Because the id parameter value comes from this function: Office365Groups.ListOwnedGroupsV3().value.

    If you directly use "id", it does not represent one specific group's id.

     

    Please set this to your gallery's Visible:

    If(IsEmpty(
     ForAll(Office365Groups.ListOwnedGroupsV3().value,
     Filter(Office365Groups.ListGroupMembers(id).value,
     User().Email in mail
     )
     )
     ),
    false,true)
    

     

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard