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 / Gallery Office365Group...
Power Apps
Unanswered

Gallery Office365Groups.ListGroupMembers not working with group ID

(0) ShareShare
ReportReport
Posted on by

I want to display the members of a mail-enabled security group in a gallery.

 

In Flow if I use a "List group members" action with the ID of my my mail-enabled security group, the correct info is returned. 

However if I use that same ID in the function: 

 

Office365Groups.ListGroupMembers('mygroupID')

I get "Name isn't valid. The identifier isn't recognized"

 

I have added Office 365 connector to connections and to data sources

If I set the gallery to: 

Office365Groups.ListOwnedGroups().value

it shows me (some of) my Office 365 groups, but not mail-enabled security groups.

However, I have tried 

Office365Groups.ListGroupMembers('mygroupID')

using an Office 365 Group - but same error. 

And when I try the below same issue, even when I use the group ID of one of the groups that shows up in the "ListOwnedGroups" function above.

Filter(Office365Groups.ListOwnedGroups().value, id='MyGroupdID')

I am getting the group ID from Azure Active Directory. 

Thanks for your help

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    The problem is with your premise.  A mail enabled security groups is NOT an Office 365 group, so there is no way to get the members of that kind of group using the Office365Groups connector.  I think your process is OK, but you need to use the Azure 

    AD connector instead of the Office365Groups connector.

  • Community Power Platform Member Profile Picture
    on at

    @Pstork1 

    But I've also tried the ListGroupMembers formula with an Office 365 group as well.

    It didn't work either. 

    Are you able to use it on an O365 Group?

     

    Thanks,

    Sylvie 

  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Yes, it does work for me with my Office 365 groups.  I created a label and set its text property to

    First(Office365Groups.ListOwnedGroups().value).id

    That gives me the Id of the first O365 group in my tenant.

    Then I set the Items property of the gallery to

    Office365Groups.ListGroupMembers(LabelName.Text).value

    Then added a textbox to the gallery template and set its Item property to

    ThisItem.DisplayName

    The key is making sure you get the right Id for the group.

  • Community Power Platform Member Profile Picture
    on at

    YES @Pstork1  YOU BEAUTIFUL GENIUS!!

    Not only is this working perfectly - it is actually working for MAIL ENABLED SECUIRTY GROUPS!!

    It was just my syntax. I needed the .value (of course)

     

    So I set my label to the sec group ID (which I got from Azure AD)

    Then did as you said for the gallery and now I'm set. I have what I want.

    Thank you!!!

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    You should be able to actually use the formula from the Text property of the label directly in the other formula.  I just created a label to make sure I was getting what I thought I was.

  • shred_yerbootie Profile Picture
    12 on at
    Hello! Trying to get the email addresses from an Exchange Distribution List and this thread popped up.
     
    This seems like a similar issue, but I'm getting the following error: 
    "Office365Groups.ListGroupMembers failed: Request_ResourceNotFound, Resource <the Exchange DL ID of my group> does not exist or one of its queried reference-property objects are not present"
     
    Might it be that I want to find a DL and those are different from Security Groups? Any suggestions on how to proceed? 
     
    Many thanks in advance! 
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at
    @shred_yerbootie  Unfortunately, this solution won't work for you. This thread is talking about getting the members from a mail enabled security group.  A straight distribution list isn't accessible the same way as a security group.  This post talks about how to do it using Microsoft Graph, but I've never tried. I don't know of any other way to do it.  Power Automate - Get Outlook Email Distribution Groups - Stack Overflow

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     

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