cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BethanyJake
Level: Powered On

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
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
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

BethanyJake
Level: Powered On

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,826)