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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sorting a gallery by p...
Power Apps
Answered

Sorting a gallery by person/group column

(1) ShareShare
ReportReport
Posted on by 62

Hi everyone,

I'm facing an issue with sorting a gallery in Power Apps that's connected to a SharePoint list. My current gallery items property code looks like this:

 

If(
 show_duplicate = "",
 Filter(PPS_Certification, StartsWith(Name.Email, usersetting_user_search.Text)),
 Filter(PPS_Certification, Name.Email = show_duplicate)
)

 

The gallery displays data from the "PPS_Certification" list. I want to sort it alphabetically by a column called "Name," but I'm running into problems because "Name" is a Person or Group column.

I came across another forum post where someone suggested creating a new calculated column in SharePoint to extract the display name and then sort by that column in Power Apps. However, when I try to create this calculated column, I get a syntax error. Here's the formula I'm using:

 

=Name.DisplayName

 

I'm not sure why this is happening. The column "Name" definitely exists and is a Person or Group type. Any help or suggestions would be greatly appreciated!

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @SeifAltamimi a People field is a complex data type which stores a record, and different complex data types (e.g. Choices, Lookup) contain different attributes in that record.

     

    For a People data type, there are 6 attributes:

     

    • Claims
    • Department
    • DisplayName
    • Email
    • Job Title
    • Picture

     

    For your scenario, ycan sort on the "DisplayName" attribute. Basic example below:

     

    Sort(
     'PPS_Certification',
     Name.DisplayName,
     SortOrder.Ascending
    )

     

    Note that sorting on complex data types with SharePoint is not delegable.

     

    Further reading on tables, records and values: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-tables 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard