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

SortByColumn for person column

I can't seem to get SortByColumn in a Gallery to work for a column that is a 'person or group' column.

 

Admin directed me to this site.

 

Any suggestions?

 

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

 

SortByColumns(
  Filter(
AddColumns(    
'Town Daily Task List',
     "PersonsName",
     PersonColumn*.DisplayName  
), StartsWith(Title, TextSearchBox1.Text) ), "PersonsName", If(SortDescending1, Descending, Ascending) )

 * Replace bold with your Person/group column name

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @andyJDL

 

You can not use SortByColumn() with SharePoint List "person or group" column.

 

 

Thanks, is there any other option to get the same result?

 

Andy

Anonymous
Not applicable

Hi @andyJDL

 

Actually as I was writing that it is imposible I had an idea and it works.

 

Put this in Gallery.Items:

SortByColumns(
  AddColumns(
    SharePoint_List,
    "PersonsName",
    PersonColumn.DisplayName
  ),
  "PersonsName"
)

* Replace the bold items with actual column names in your SharePoint List

 

 

Thanks again.  Any suggestion how to include that in addition to this:

 

SortByColumns(Filter('Town Daily Task List', StartsWith(Title, TextSearchBox1.Text)), "ListOrder", If(SortDescending1, Descending, Ascending))

Anonymous
Not applicable

 

SortByColumns(
  Filter(
AddColumns(    
'Town Daily Task List',
     "PersonsName",
     PersonColumn*.DisplayName  
), StartsWith(Title, TextSearchBox1.Text) ), "PersonsName", If(SortDescending1, Descending, Ascending) )

 * Replace bold with your Person/group column name

 

Thanks!  that works.

 

If I haven't asked too much already, is there any way to sort so that empty cells get listed at the top?

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,801)