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
Solved! Go to Solution.
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.
Hope this helps.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
@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.
Hey @krishnags , can you elaborate a little more on your proposed solution ? Thank you
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.
Hope this helps.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
User | Count |
---|---|
152 | |
93 | |
84 | |
77 | |
58 |
User | Count |
---|---|
194 | |
174 | |
106 | |
96 | |
89 |