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.

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.

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 92 members 3,900 guests
Please welcome our newest community members: