web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps sort order n...
Power Apps
Answered

Powerapps sort order not the same as Sharepoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

 

I really am not sure why this issue is occurring or how to rectify it so would really appreciate some help if possible please?

 

I have a Sharepoint list with a few columns that is sorting by "Date of pickup:" first and "Time of pickup:" second. The trouble is, when I add things to this Sharepoint list, my Powerapp doesn't sort the newly added items in the correct order even though my Sharepoint list does.

 

Sharepoint list order:

Date-Time.JPG

 

Powerapp order:

Wrong order.jpg

 

Power app gallery sort function:

 

SortByColumns(Filter('Transport Booking Summary', StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

I know the issue lies in the above formula but I can't for the life of me work it out.

 

Would anyone be able to shed some light on this for me please?

 

It's the only thing left stopping me being able to use the app.

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Could you please share a bit more about the Time of pick up: column in your SP list? Is it a Choice type column?

    Do you want to sort your Gallery items by  "Date of pickup:" field and "Time of pickup:" field?

    Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

    If the Time of pick up: column is not a Choice type column, please modify your formula as below:

    SortByColumns(
    Filter('Transport Booking Summary', StartsWith(Title, TextSearchBox1.Text)),
    "Date_x0020_of_x0020_pickup", If(SortDescending1, Descending, Ascending),
    "Time_x0020_of_x0020_Pick_x0020_u", If(SortDescending1, Descending, Ascending)
    )

    Note: The 'Time_x0020_of_x0020_Pick_x0020_u' represents the Time of pick up column in your SP list. I assume the 'Date of pickup' column is a Date type column in your SP list.

     

    If the Time of pick up: column is a Choice type column, please take a try with the following workaround:5.JPG

    Set the Items property of the Gallery to following:

    SortByColumns(
    AddColumns(Filter('20190126_case3', StartsWith(Title, TextSearchBox1.Text)), "TimeOfPickup",'Time of pick up:'.Value),
    "Due_x0020_Date", If(SortDescending1, Descending, Ascending),
    "TimeOfPickup", If(SortDescending1, Descending, Ascending)
    )

    On your side, you should type:

    SortByColumns(
    AddColumns(
    Filter('Transport Booking Summary', StartsWith(Title, TextSearchBox1.Text)),
    "TimeOfPickup",
    'Time of pick up:'.Value
    ),
    "Date_x0020_of_x0020_pickup", If(SortDescending1, Descending, Ascending),
    "TimeOfPickup", If(SortDescending1, Descending, Ascending)
    )

    Note: The Choice type column could not be used as a Sort column within the SortByColumns function.

    More details about AddColumns function, please check the following article:

    AddColumns function

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xida-msft (Kris

     

    Thank you! This worked:

     

    New formula.JPG

     

    I had manually adjusted my formula to reflect the changes that you suggested but it kept failing. I copied/pasted your formula in, made the column names totally accurate (from a powerapps table I made) and it WORKED!

     

    Thanks again. I'm sure many around here would say the same but I couldn't have done it without you!

     

    Have a good day

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard