cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TriEssent
New Member

Sorting BrowserGallery1

Hello,

I am trying to sort my screen by date instead of by title. I am unsure of the syntax to use here. My date column is called "Date".

Thanks in advance for any help that can be given.

 

This is the current syntax:

SortByColumns(Filter([@'RV-XFMR-PM'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@TriEssent 

Please consider changing your Formula to the following:

SortByColumns(
    Filter([@'RV-XFMR-PM'], 
        StartsWith(Title, TextSearchBox1.Text)
    ), 
    "Date", 
    If(SortDescending1, Descending, Ascending)
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@TriEssent 

Please consider changing your Formula to the following:

SortByColumns(
    Filter([@'RV-XFMR-PM'], 
        StartsWith(Title, TextSearchBox1.Text)
    ), 
    "Date", 
    If(SortDescending1, Descending, Ascending)
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

v-qiaqi-msft
Community Support
Community Support

Hi@TriEssent,

Based on the issue that you mentioned, do you want to sort the Date column within your 'RV-XFMR-PM'?

Could you please share a bit more about the scenario?

I agree with @RandyHayes, the formula he provided is correct, if you just need to sort the Date column and search Title column for the start string, just do it.

If you also want to search the Date column based on the start string, I think I could do some addition.

 

SortByColumns(Filter([@'RV-XFMR-PM'], StartsWith(Text(Date), TextSearchBox1.Text)), "Date", If(SortDescending1, Descending, Ascending))

 

Note: This may cause a delegation warning for the Text() function. If your data set is not very huge, you could ignore it.

Hope it could help you.

Best Regards,

Qi

 

Best Regards,
Qi

Thank you for your help, @RandyHayes. If I may ask - where does the SortOrder.Descending go to make it sort with the newest dates on top?

This seems to work:

 

SortByColumns(Filter([@'RV-XFMR-PM'], StartsWith(Title, TextSearchBox1.Text)), "Date",Descending)

RandyHayes
Super User
Super User

@TriEssent 

Yes, that will give you a sorted list of dates with most recent at the top.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,987)