Hi All,
I have an access code app with a search bar but I also want to add a filter buttons.
The code I am using at the moment for the search function is:
SortByColumns(
Filter([@'NC Codes'],
StartsWith(
'Location of Coded Lock',
TextSearchBox1.Text
) && !'Manager Code'&& !'Paramedic Code'
),
"Title",
If(
SortDescending1,
Descending,
Ascending
)
)
In my records, I have a location field called 'Locality' where we can select a location from a drop down. I have added a horizontal gallery and want to use it as filter buttons so a user can just filter the area where they are, saving them scrolling through all of the codes.
I'm not sure how I can integrate this with the above code so that when a user selects the 'Hunts' button, it filters the Locality Field.
Can anyone help with that?
Assuming the horizontal gallery is called Gallery1,
With(
{codes: SortByColumns(
Filter(
[@'NC Codes'], StartsWith(
'Location of Coded Lock',
TextSearchBox1.Text
)
&& !'Manager Code'
&& !'Paramedic Code'
), "Title", If(
SortDescending1,Descending,Ascending
)
)
},
},
Filter(
codes, Localitiy = Gallery1.Selected.Locality
)
)
Hi @Drrickryp
Sorry I have only just round to looking at this.
I tried your suggestion but I have two errors:
= and .Selected.Locality
Not sure if would make a difference, but the locality field is a choice field. If I delete .Locality, the only options PowerApps gives me is .Value and Label7 (I'm not sure why its showing Label7).
Please update your filter (Combo box) and search criteria
Filter with Search
With(
{sData: 'Issue tracker'},
Search(
Sort(
Filter(
sData,
Priority.Value = ComboBox3.Selected.Value
),
'Date reported',
Descending
),
TextSearchBox1.Text,
"Title"
)
)
I've made some modifications - One thing I forgot about, the locality field has 'Huntingdon' selected but the button was set to 'Hunts'
So it's now filtering but the 'All' option does not work - Will this be because locality field does not have 'All' selected along side 'Huntingdon' ?
How would I get it to display all data with using the 'All' button in Gallery1' without having to place 'All' in the locality field?
Hi @AdamH
I believe you are filtering Gallery and Locality is a choice in SP. So filter should be
Locality.Value = Dropdown3.Selected.Value
User | Count |
---|---|
151 | |
94 | |
85 | |
77 | |
58 |
User | Count |
---|---|
193 | |
175 | |
105 | |
96 | |
90 |