Hi we are building a CDS sourced app & want to have multiple (4) filters (dropdowns) on the first screen that once set hold across all screens. The fields we wish to filter by are across multiple entities.
Each screen we want to hold the filter over has a form to display data that is ordered and searched via a gallery.
e.g. SCREEN 1 - The first filter we want is called 'Property', it is a common field to all entities. SCREEN 2 - on our assets screen (assets entitiy) we want to filter the gallery by the selection in the first screen.
We have attempted many options and scoured the forums for help but are finally posting. Our current best (but failing) option is using the drop down to set a value "MyProperty" to the selection, then applying this to the gallery, but it doesn't carry.
Part two will be to display an non controllable visual indicating which filters are applied.
It sounds like what you are currently doing is correct - using the Set function to store your variables from the DropDown lists that will persist across screens and use those to filter your galleries. Note that you must use the Set function as UpdateContext will not persist across screens.
If you are using the Set command already then it might be the case your Screen2Gallery.Items formula could be incorrect given the complexity of having 4 seperate filters and returning the wrong set of results. If you could share what formulas you are using on the dropdown.OnChange event and your Screen2Gallery.items we could have a look to see if there are any issues.
As for part 2 of your question, if following the above method and setting a global variable you could do something like the below but extended for your multiple filters:
It didn't work, I'm assuming due to the error on the drop down.
For reference we have built a stacked filter to allow searching by many fields, the filter function will stack into the follwing;
Sort(If(IsBlank(TextInput_Asset_View.Text), Assets_ADAMM, Filter(Assets_ADAMM,TextInput_Asset_View.Text in AssetName,TextInput_Asset_View.Text in LocationofAsset, TextInput_Asset_View.Text in Manufacturer, TextInput_Asset_View.Text in Model, TextInput_Asset_View.Text in RatingorCapacity, TextInput_Asset_View.Text in SerialNumber)), AssetName, If(SortDescending2, SortOrder.Descending, SortOrder.Ascending))