cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Sortbycolumns sorts lower upper and proper separately

I was building a powerapp for a long standing sharepoint list that is quite large. And I found that it sorted things in all lower case, then proper, then all caps. So like smith it was

 

smith, richard

Smith, A

Smith, Bob

Smith, John

SMITH, ANDREW....

etc

 

Is there some way to get it to sort it together?

 

Here’s my command

 

SortByColumns(ColRecruitmentState,”Last_x0020_Name”, Ascending, “First_x0020_Name”, Ascending,”State”, Ascending)

 

I tried putting Upper() around the last name column but it threw an error.  Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @BethanyJake 

To sort by the upper cased lastname and firstname, you can add columns that contain the upper cased representation of the lastname and firstname columns, and then sort by those.

The syntax would look like this:

SortByColumns(AddColumns(ColRecruitmentState,
                         "LastNameUpper",
                         Upper(Last_x0020_Name),
                         "FirstNameUpper",
                         Upper(First_x0020_Name)
              ),
              "LastNameUpper",
              Ascending,
              "FirstNameUpper",
              Ascending,
              "State",
              Ascending
)

Hopefully, this will take you a bit further.

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @BethanyJake 

To sort by the upper cased lastname and firstname, you can add columns that contain the upper cased representation of the lastname and firstname columns, and then sort by those.

The syntax would look like this:

SortByColumns(AddColumns(ColRecruitmentState,
                         "LastNameUpper",
                         Upper(Last_x0020_Name),
                         "FirstNameUpper",
                         Upper(First_x0020_Name)
              ),
              "LastNameUpper",
              Ascending,
              "FirstNameUpper",
              Ascending,
              "State",
              Ascending
)

Hopefully, this will take you a bit further.

View solution in original post

Thanks! that worked perfectly.  I hadn't thought of adding a column to make it work but it took care of it cleanly!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,505)