cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Responsive Resident
Responsive Resident

See users in multiple Office 365 Groups

Hello,

 

I am pulling in about 10 Office 365 groups into my PowerApp to leverage permissions. Now some users can reside in many different groups, i need to figure out to see if they do reside in multiple groups and which ones. Currently i can see if they reside in one group through an If statement but that stops once it finds the first group that user resides in. 

 

Anyway I can see if they do reside in multiple groups and which ones.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @mmattar ,

 

Do you want to filter users that in multiple O365 groups and see which groups they are in? Could you please share more details about your using controls? How did you retrieve the groups and display them? Are you a member of all these groups?  And what is the whole formula of the If statement?

 

Assuming that you own or belong to all the groups, I made a test and get the result you want:

1. Set below formula in OnVisible of the Screen or OnStart of the App to collect all groups and users in these groups:

 

ClearCollect(colGroups,Office365Groups.ListOwnedGroupsV3().value);Clear(colGroupUsers);ForAll(colGroups,Collect(colGroupUsers,Office365Groups.ListGroupMembers(id).value))

 

2. Set below formula in Items of a Gallery to display all group members without duplication:

 

Distinct(colGroupUsers,displayName)

 

3. Set Color of the lable in the gallery to below, make users in multiple groups display in red color:

 

If(CountRows(Filter(colGroupUsers,displayName=ThisItem.Result))>1,Red,Black)

 

 4. Set below formula in Items of another gallery to display the groups that user selected from above gallery belong to: 

 

Filter(colGroups,Gallery2.Selected.Result in Office365Groups.ListGroupMembers(id).value.displayName)

 

 

Now you could select in Gallery to see the groups it belongs to.

groups.gif

 

Hope this helps.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
krishnags
Responsive Resident
Responsive Resident

@mmattar you can multiple filters and capturing the output into a collection using concurrent. This way you can be able to run parallel operations and add If condition post concurrent.

mmattar
Responsive Resident
Responsive Resident

Hey @krishnags , can you elaborate a little more on your proposed solution ? Thank you

v-jefferni
Community Support
Community Support

Hi @mmattar ,

 

Do you want to filter users that in multiple O365 groups and see which groups they are in? Could you please share more details about your using controls? How did you retrieve the groups and display them? Are you a member of all these groups?  And what is the whole formula of the If statement?

 

Assuming that you own or belong to all the groups, I made a test and get the result you want:

1. Set below formula in OnVisible of the Screen or OnStart of the App to collect all groups and users in these groups:

 

ClearCollect(colGroups,Office365Groups.ListOwnedGroupsV3().value);Clear(colGroupUsers);ForAll(colGroups,Collect(colGroupUsers,Office365Groups.ListGroupMembers(id).value))

 

2. Set below formula in Items of a Gallery to display all group members without duplication:

 

Distinct(colGroupUsers,displayName)

 

3. Set Color of the lable in the gallery to below, make users in multiple groups display in red color:

 

If(CountRows(Filter(colGroupUsers,displayName=ThisItem.Result))>1,Red,Black)

 

 4. Set below formula in Items of another gallery to display the groups that user selected from above gallery belong to: 

 

Filter(colGroups,Gallery2.Selected.Result in Office365Groups.ListGroupMembers(id).value.displayName)

 

 

Now you could select in Gallery to see the groups it belongs to.

groups.gif

 

Hope this helps.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,427)