cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PGTips
Level: Powered On

How to display all the Office 365 groups a user is a member of

Please could someone guide me on this.

 

I'd like display all the Office 365 Groups the logged in user is a member of. 

 

I've added the Office 365 Groups connector, but don't know how to actually use Office365Groups.ListOwnedGroups() to display all the user's Groups into a gallery. I've tried using it for the items on a gallery control, but it doesn't do anything. 

 

Thanks

9 REPLIES 9
Community Support Team
Community Support Team

Re: How to display all the Office 365 groups a user is a member of

Hi @PGTips,

 

To have the groups displayed in the Gallery, under the items property, enter the following:

Office365Groups.ListOwnedGroups().value

5.PNG

 

For the detailed usage of this connector, please check the article below:

Office 365 Groups

 

Please post back if you have any further questions.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
frodofrod
Level: Powered On

Re: How to display all the Office 365 groups a user is a member of

I have the same question - but this answer gives the owned groups, not the belonged-to groups?

 

I'm trying to add logic to an app which depends on membership of a group. I've tried the approach in https://powerapps.microsoft.com/en-us/blog/implementing-role-based-permission/ which should give access to any group and its members via Graph, but  it's  complicated and I failed to get it to work.

 

I spotted that there is a connector for Office365 Groups, so am trying to use those instead. If I know the id of the group (which I can get if I own the group) I can use that as a constant in the app to access it. But it would be better to get the id at runtime for any user.

 

Any ideas?

 

 

PGTips
Level: Powered On

Re: How to display all the Office 365 groups a user is a member of

Hi, as per the other post - this doesn't return all the groups a user is a member of.

 

How can I show a list of every group a particular user is a member of?

 

I've tried using the AzureAD connector (AzureAD.CheckMemberGroups) , but it keeps telling me:

 

"This function can only be used in action rules"

 

 

Super User
Super User

Re: How to display all the Office 365 groups a user is a member of

I need an answer to this question too.  I fell into the same "owner" vs "member" trap.  I was thrilled, soon to find out that I, the owner, was the only one my app was working properly.  Its rediculous to have an owner of and not a member of control.  I cant even get a list to populate a table, or to pull the data into a gallery via connection.  I'm just not sure what the purpose of this connection is if you cant use is in a practical manner.  I need some direction here!

Super User
Super User

Re: How to display all the Office 365 groups a user is a member of

Any help with this one?  Its getting critical for my app.  I need the securities this can provide.  I just need a way to get group membership status for user()

beans
Level: Powered On

Re: How to display all the Office 365 groups a user is a member of

You will need to use Microsoft Graph via a custom connector - See if this link helps: https://powerapps.microsoft.com/en-us/blog/implementing-role-based-permission/ I have posted this enhancement request.... https://powerusers.microsoft.com/t5/PowerApps-Ideas/Current-Office365-User-should-be-expanded-to-ret... - please vote;

Super User
Super User

Re: How to display all the Office 365 groups a user is a member of

This how I ended up doing this.  I created a "User Authority" Screen.  I created three labels, named them Approver, Creator, Editor.

 

I have Office365 groups with similar names.

 

I created a Gallery of all my 365 goups, using the item control, naming it GroupIDList:

 

 

Office365Groups.ListOwnedGroups().value

I show the Group name and the cryptic ID List, for use in the next command.

 

 

I then created three galleries, doing a manual lookup for the group ID, and for user().  If the user is in that group, only their name appears in the gallery.

 

Search(Office365Groups.ListGroupMembers("<the long ID copied manually>").value,User().FullName,"displayName")

Then, in each of the labels, I check if the filter returned any values (one means the user() is in that group).

 

If((CountRows(ApproverGallery.AllItems))=1,true,false)

Now, I use the label I named "Approver"  in my controls.  I just have to remember to put ".text" at then end of it because its not a real variable, but the name of the label.  

 

This is how it looks to turn "on" a button if I am an approver, this is in the "visible" control:

 

If(Approver.Text="true",true,false)

It might seem a little convoluted, but it seems way less involved and complicated compared to the other example.

AveDog08
Level: Powered On

Re: How to display all the Office 365 groups a user is a member of

I have the same issue. Theres a limit of 100 when just trying to list all of the members of a single group as well. PowerApps is frustrating.


@PGTips wrote:

Hi, as per the other post - this doesn't return all the groups a user is a member of.

 

How can I show a list of every group a particular user is a member of?

 

I've tried using the AzureAD connector (AzureAD.CheckMemberGroups) , but it keeps telling me:

 

"This function can only be used in action rules"

 

 



@PGTips wrote:

Hi, as per the other post - this doesn't return all the groups a user is a member of.

 

How can I show a list of every group a particular user is a member of?

 

I've tried using the AzureAD connector (AzureAD.CheckMemberGroups) , but it keeps telling me:

 

"This function can only be used in action rules"

 

 


 

StephenPort
Level: Powered On

Re: How to display all the Office 365 groups a user is a member of

Hi

You could use the microsoft teams connector (although requires you to be using MS Teams I assume)
MicrosoftTeams.GetAllTeams().value.displayName
You can add this to a drop down control and it will display all the teams a user is a member of

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 48 members 4,827 guests
Please welcome our newest community members: