cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
mdevaney
Super User III
Super User III

@Anonymous 

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
mdevaney
Super User III
Super User III

@Anonymous 

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

Anonymous
Not applicable

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (75,513)