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

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

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard