web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery to display gro...
Power Apps
Unanswered

Gallery to display group members AND people in SharePoint list

(0) ShareShare
ReportReport
Posted on by 64

I have an app that will be accessible to members of an O365 Group by default. Those members will also be able to grant access to additional users, which are being maintained in a SharePoint list. I'm trying to display both lists of users in one gallery, but can't quite get the data points to line up correctly. Here's what I've done so far: 

 

I've converted the Group Members to have the same syntax as People in SharePoint, and then built a collection to add these users and a People column from another list.

OnStart

Set(
varProgramManagerMembers,
RenameColumns(
AddColumns(
ShowColumns(
Office365Groups.ListGroupMembers("LIST ID HERE").value,
"mail",
"displayName",
"jobTitle"),
"Claims", "i:0#.f|membership|" & ThisRecord.mail,
"Department", "",
"Picture",""),
"mail","Email",
"displayName", "DisplayName",
"jobTitle", "JobTitle"));

ClearCollect(colAllAppUsers,
varProgramManagerMembers,IdeaDashboardUsers);

 

I can set the item property of my gallery to colAllAppUsers, but it doesn't lump all the users together with the same properties like I'd expect, so I have to add labels and pull in both ThisItem.DisplayName AND ThisItem.AppUser.DisplayName. I can make this work by playing with visibility of the labels, but there has to be another way to convert them all to the same format, right? Please help! 🙂 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JennC26 ,

     

    I assume IdeaDashBoardUsers is a data source that has a column called AppUser which is a person/group type, correct?

     

    If correct, the below should fix things:

     

    Set(
    varProgramManagerMembers,
    RenameColumns(
    AddColumns(
    ShowColumns(
    Office365Groups.ListGroupMembers("LIST ID HERE").value,
    "mail",
    "displayName",
    "jobTitle"),
    "Claims", "i:0#.f|membership|" & ThisRecord.mail,
    "Department", "",
    "Picture",""),
    "mail","Email",
    "displayName", "DisplayName",
    "jobTitle", "JobTitle"));
    
    ClearCollect(colAllAppUsers,
    varProgramManagerMembers,IdeaDashboardUsers.AppUser);

     

    What is does is select the AppUser column in the IdeaDashBoardUsers data source and return the same schema as what you built for varProgramManagerMembers.

  • JennC26 Profile Picture
    64 on at

    @BCBuizer Thanks for the reply! Unfortunately that brought in the same results - I still see the collection as 2 groups/batches of people, the AppUsers, and the Group members. When I go to add the collection to the gallery, if I display ThisItem.DisplayName, it only shows labels for the group members, the others are blank, and then vice versa if I display ThisItem.AppUser.DisplayName. So, it feels like I'm missing a step somewhere to get them all to populate the same way.

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JennC26 ,

     

    Indeed, somehow ungrouping of person records is not working as expected. With the below I got the desired outcome though. It does feels a bit clunky, but I don't have time to look into this further. 

     

    Clear(colAllAppUsers);
    
    ForAll(
     Office365Groups.ListGroupMembers("GROUP ID HERE").value,
     Collect(
     colAllAppUsers,
     {
     Claims: "i:0#.f|membership|" & ThisRecord.mail,
     Department: "",
     Picture: "",
     Email: ThisRecord.mail,
     DisplayName: ThisRecord.displayName,
     JobTitle: ThisRecord.jobTitle
     }
     )
    );
    
    ForAll(
     IdeaDashboardUsers.AppUser,
     If(
     !IsBlank(ThisRecord.AppUser),
     Collect(
     colAllAppUsers,
     {
     Claims: ThisRecord.AppUser.Claims,
     Department: ThisRecord.AppUser.Department,
     Picture: ThisRecord.AppUser.Picture,
     Email: ThisRecord.AppUser.Email,
     DisplayName: ThisRecord.AppUser.DisplayName,
     JobTitle: ThisRecord.AppUser.JobTitle
     }
     )
     )
    );

     The If statement is included to prevent blank items from being collected. Not sure if you need that, but it can't hurt.

  • JennC26 Profile Picture
    64 on at

    Ahhh!!! @BCBuizer  You are a lifesaver! Clunky or not, it gives me what I need to display. Thank you so so much for your help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard