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

Powerapps sort order not the same as Sharepoint list

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Powerapps sort order not the same as Sharepoint list

Hi @FlowFail,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Powerapps sort order not the same as Sharepoint list

Hi @FlowFail,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FlowFail
Level: Powered On

Re: Powerapps sort order not the same as Sharepoint list

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

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 432 members 5,382 guests
Please welcome our newest community members: