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 / Sort a Gallery where C...
Power Apps
Answered

Sort a Gallery where Column is SharePoint Person

(0) ShareShare
ReportReport
Posted on by 127

Hi,

 

I have a SharePoint List which has 2 columns: 

  • Title (Pod Name)
  • Name

Name is a Person column in SharePoint.

 

In PowerApps, I have a gallery which pulls through the names and Pod Names. I also have a Text Input to allow users to filter the gallery.

I want to sort the gallery in to Name alphabetical order. Here is my current code:

 

SortByColumns(
If(IsBlank(TextInput2.Text), 'PSMC Cover Pods', Filter('PSMC Cover Pods', TextInput2.Text in Name.DisplayName)),"{Name}")

 

This current sorts by Title (Pod Name) and not Name. Can anyone help?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @VictorTek

    SortByColumns(
    Filter('PSMC Cover Pods',Len(TextInput2.Text)=0 || TextInput2.Text in Name.DisplayName),
    "Name",SortOrder.Ascending)

     

  • VictorTek Profile Picture
    127 on at

    Thanks @Drrickryp  - however the above returns an error saying "The function "SortByColumns" has some invalid arguments"

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @VictorTek 

    See if Intellisence suggests an alternative for your "Names" column.  Is Names a complex type column?

  • VictorTek Profile Picture
    127 on at

    It is a Person column in SharePoint. It allows you add people from AD:

    VictorTek_0-1680028244272.png

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @VictorTek 

    Then you may need to use AddColumns() to add the Value of the field to reshape the table so you can sort it. 

    With({_items:AddColumns('PSMC Cover Pods',"dname",Name.DisplayName)},
    
    SortByColumns(
     Filter(_items,Len(TextInput2.Text)=0 || 
     TextInput2.Text in dname
     ),"dname", SortOrder.Ascending
    )
    )
  • VictorTek Profile Picture
    127 on at

    Thanks!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 839

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 412

Last 30 days Overall leaderboard