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
Solved! Go to Solution.
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)
)
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?
@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?
@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?
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
72 | |
50 | |
41 | |
30 |
User | Count |
---|---|
253 | |
113 | |
95 | |
91 | |
76 |