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
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,147)