cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sort gallery by date field in addition to filtering by two text search fields

Hi,

 

I have a gallery which is filtered using two search text fields which is working correctly but i also want to be able to do a simple sort of the gallery using my ReceivedBy date field. Currently i am using a radio button to flip between the search fields ("CLIENT NAME" & "CLIENT CODE"); I have added another radio button option: "REQUIRED BY (SORT)". I want the user to select that option and then click a sort icon to just sort the gallery by ReceivedBy date -ascending/descending. I have a sort icon with this OnSelect formula: UpdateContext({SortDescending1: !SortDescending1})

 

Here is the Items formula for the gallery: 

If(Radio1.Selected.Value="CLIENT NAME",SortByColumns(Filter(SP List',StartsWith(ClientName,ClientSearchBox.Text)),"ClientName",If(SortDescending1, Ascending,Descending)),SortByColumns(Filter('SP List',StartsWith(ClientCode,ClientCodeSearchBox.Text)),"ClientCode",If(SortDescending1, Ascending,Descending)))

 

how do i amend the above formula so i can sort the gallery by RequiredBy date as well?

 

any help much appreciated

 

kind regards,

 

Mike

29 REPLIES 29
Anonymous
Not applicable

Hi Randy,

 

UrgentStatus is a single line of text column and yes (you've caught me) 'iXBRL Log' is the name of the list. I have also added the name of the radio button below for full disclosure.

SortByColumns( Filter('iXBRL Log', Switch(HomeSearchRadio.Selected.Value "CLIENT NAME", StartsWith(ClientName, ClientSearchBox.Text) "CLIENT CODE", StartsWith(ClientCode, ClientCodeSearchBox.Text), "URGENT", UrgentStatus = "Yes", true ) ), "Created", If(SortDescending1, Ascending,Descending) ). 

I added the above but the gallery still does not filter on UrgentStatus

Mike

@Anonymous 

It appears that I had missed a few commas in my formula...please correct to the following:

 

SortByColumns( 
    Filter('iXBRL Log', 
        Switch(HomeSearchRadio.Selected.Value, 
            "CLIENT NAME", StartsWith(ClientName, ClientSearchBox.Text), 
            "CLIENT CODE", StartsWith(ClientCode, ClientCodeSearchBox.Text), 
            "URGENT", UrgentStatus = "Yes", 
            true 
        ) 
     ), 
     "Created", 
     If(SortDescending1, Ascending,Descending) 
)

 

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Still not filtering on Urgent for some reason - i don't get any error with the formula though

 

 

 

@Anonymous 

Change your formula to the following:

Filter('iXBRL Log', 
    UrgentStatus = "Yes"
)

Does that show just Urgent items?

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

yes

@Anonymous 

Change to:

Filter('iXBRL Log', 
    Switch(HomeSearchRadio.Selected.Value, 
        "URGENT", UrgentStatus = "Yes",
        false
    ) 
)

Put your Radio control to "URGENT"

This will  either produce all Urgent items listed or none.  Which do you get?

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

I get nothing in the gallery

@Anonymous 

Place a label on the screen and set the Text property to:

HomeSearchRadio.Selected.Value = "URGENT"

Set your Radio to "Urgent".  The label should read "true"

What does yours say? 

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Hi Randy, 

 

Well done! i found the issue - there was a space after Urgent. I took the space out and it is now filtering correctly. Many thanks for your patience and support on this. Have a great weekend!

 

thanks again!

 

Mike

@Anonymous 

Excellent!!!  I had a feeling there was some extra character or something going on.

 

Glad we got to the bottom of it!

Have a great weekend also.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,297)