cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
la09
Helper I
Helper I

Filter gallery using Date

Hi,

 

I am trying to sort my gallery by Ascending/Descending date when the sort button is pressed. It currently works, however it is also filtering on Name at the same time, therefore it groups people by name and then filters the date, as opposed to just filtering by date.

 

On the Items property of my gallery is the below code:

Sort(SortByColumns(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)), "Title", Descending), AdminLoginDate, If(SortDescending1, Descending, Ascending))

 

and on the 'Sort' Button is:

UpdateContext({SortDescending1: !SortDescending1})

 

Below is the picture of the 'Sort' button:

 

la09_0-1630069082428.png

 

Is there just a slight tweak required to the items gallery to remove the grouping by Name part?

 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
Nogueira1306
Super User
Super User

If(SortDescending1= true; Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Descending),

Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Ascending)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

View solution in original post

4 REPLIES 4
Nogueira1306
Super User
Super User

If(SortDescending1= true; Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Descending),

Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Ascending)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Thanks, I seem to be getting a couple of errors however

 

la09_0-1630072492597.png

 

If(SortDescending1= true, Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Descending),

Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Ascending))

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

This worked:

 

If(SortDescending1, Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Descending), Sort(Filter([@FSHubAdminLogin], StartsWith(Title, txtSearchBox.Text)),AdminLoginDate,Ascending))

 

 

Thanks for your help

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,879)