I need some help getting the right combination of code across screen for a combination of filter controls to work with a gallery.
History:
1. Built screen and gallery- all good
2. Added search Text Input box and updated Gallery code:
Search('Work Tracker', SearchInput1_1.Text, "hh") where 'Work Tracker' = SP List source, and "hh" is column name for title of work.
All works fine on the search
3. Added dropdown with following code:
Distinct('Work Tracker','Deputy Director'.DisplayName) where Deputy Director is email address from a Person Column type
4. Updated Gallery code:
Search(
Filter('Work Tracker', 'Deputy Director' = Dropdown1.Selected.Value),
SearchInput1_1.Text, "hh"
)
Stopped working.
Even in dev, values for items in labels etc displaying info has disappeared and nothing showing on preview and search and dropdown box not working.
The labels etc generally use 'ThisItem' to display text egThisItem.'Title of Work'
I am guessing I have missed something on the Gallery set up but am stumped. I'll also need to add another 2 filters as well as the search and drop down.
Thanks
Hi @SteveMForm
yes so you are handling if the search is blank.
If you want to manage also the empty dropdown
If(
Len(SearchInput1_1.Text)>1,
Filter('Work Tracker', 'Deputy Director' = Dropdown1.Selected.Value || SearchInput1_1.Text in "hh"),
Filter('Work Tracker', 'Deputy Director' = Dropdown1.Selected.Value)
)
You can manage additional filters grouping with AND / OR conditions
&& = AND
|| = OR
if you have a specific example, please provide the exact names
Thanks for your help @renatopc84_ch .
With your code, is that to handle if the search is blank? How would I handle the dropdown being blank as well. and any other additional filters?
So simple, of course! Many thanks @v-qiaqi-msft !
Hi @SteveMForm,
Since 'Deputy Director'is Person column, yuo need to refer to as below:
Search(
Filter('Work Tracker', 'Deputy Director'.DisplayName = Dropdown1.Selected.Value),
SearchInput1_1.Text, "hh"
)
Hi @SteveMForm
I suppose that is the search.
My proposal is to change the Gallery Filter, something like:
If(
Len(SearchInput1_1.Text)>1,
Filter('Work Tracker', 'Deputy Director' = Dropdown1.Selected.Value && SearchInput1_1.Text in "hh"),
Filter('Work Tracker', 'Deputy Director' = Dropdown1.Selected.Value)
)