cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: Sortbycolumns sorts lower upper and proper separately

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
Highlighted
Super User
Super User

Re: Sortbycolumns sorts lower upper and proper separately

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

Highlighted
Frequent Visitor

Re: Sortbycolumns sorts lower upper and proper separately

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,900)