cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ojack21 Helper I
Helper I

Unable to GroupBy with Sharepoint List field set to Persons/Group

Hi community,

Is there still an issue with the GroupBy if the field in Sharepoint is Person/Group? My script below won't work, even I know that it is correct, still getting the red underline. What could I possibly be missing here?

 

ProjectLead1 is a Persons/Group column in my Sharepoint list.

 

GroupBy(AddColumns(Project_Tracker, "LeadNames", ProjectLead1.DisplayName), "LeadNames", "ProjectGrouped")

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Unable to GroupBy with Sharepoint List field set to Persons/Group

@ojack21 

The display name is a person field cannot be accessed directly using AddColumn so the solution is to use ForAll to build the table instead.

 

GroupBy(
    ForAll(
        Project_Tracker, 
        {LeadNames: LeadNames, ProjectLead1: ProjectLead1.DisplayName}
    ),
    "LeadNames",
    "ProjectGrouped"
)

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Unable to GroupBy with Sharepoint List field set to Persons/Group

@ojack21 

The display name is a person field cannot be accessed directly using AddColumn so the solution is to use ForAll to build the table instead.

 

GroupBy(
    ForAll(
        Project_Tracker, 
        {LeadNames: LeadNames, ProjectLead1: ProjectLead1.DisplayName}
    ),
    "LeadNames",
    "ProjectGrouped"
)

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

ojack21 Helper I
Helper I

Re: Unable to GroupBy with Sharepoint List field set to Persons/Group

thank you @mdevaney, I fixed this one by changing my field in Sharepoint to Single selection only for this. Still your script is an alternative solution.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (9,042)