cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bouillons
Resolver I
Resolver I

Using Office365Groups.ListGroupMembers with nested groups

I'm inspecting group membership to control view/edit access to parts of my App using the Office365Groups connector.

 

I'm using the following instruction to check if a user is a Telecom Manager:

Set(gTelecomManager,!IsEmpty(Filter(Office365Groups.ListGroupMembers(gTelecomManagersGroup).value,mail=User().Email)));

 

This works fine if the group contains individual users, but when I add another security group to the TelecomManagers Group instead of using individual members, the  instruction returns false, even if the user is part of (one of) the member group(s) of the Telecom Managers group. I could go recursively through the group(s) and check deeper and deeper until I get to the individual user level, but this will quickly get wieldy and probably slow. What would be the recommended way to make this work ?

 

Stephane

 

1 ACCEPTED SOLUTION

Accepted Solutions
bouillons
Resolver I
Resolver I

Hi, based on Solved: Office365Groups Connector to security group - Power Platform Community (microsoft.com), I used another connector. the AzureAD connector has more capabilities and it takes nested group membership into account.

 

Set(gTelecomManagersGroup,"12db ... ID of the Group ... 8ca6");
Set(gTelecomManager,!IsEmpty(Filter(AzureAD.GetMemberGroupsV2(User().Email, true).value, Value=gTelecomManagersGroup)));

 Stephane

View solution in original post

3 REPLIES 3
bouillons
Resolver I
Resolver I

I tried the other way around, by using the ListOwnedGroupsV3 to see if the group I need to be part of to edit/view something in the App returns any rows.

 

Filter(Office365Groups.ListOwnedGroupsV3().value,StartsWith(displayName,"SG_TelecomManagers"))

 

Unfortunately this method only returns Office365 groups, and not AD security groups. Even if I base my security on Office365 groups instead of AD Security groups, I'm still stuck as I will have to add individuals instead of groups as members of the TelecomManagers group.

 

Stephane

bouillons
Resolver I
Resolver I

Hi, based on Solved: Office365Groups Connector to security group - Power Platform Community (microsoft.com), I used another connector. the AzureAD connector has more capabilities and it takes nested group membership into account.

 

Set(gTelecomManagersGroup,"12db ... ID of the Group ... 8ca6");
Set(gTelecomManager,!IsEmpty(Filter(AzureAD.GetMemberGroupsV2(User().Email, true).value, Value=gTelecomManagersGroup)));

 Stephane

alrez
Community Support
Community Support

Hi,

 

Thanks for your post! I am glad that you were able to get this issue resolved. Hopefully this will prove useful for future communities users.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,319)