I have a gallery which displays item from a table.
I have three dropdowns to filter the items based on what people want to see.
If I choose a department in one dropdown filter, then the list will display all items owned by the department. The issue is that the other filter dropdowns still will have all options available, even those who do not apply for this department. So you can possibly get a blank list.
The ideal situation is that the dropdowns only will show filters which apply to the other selected filter.
I use this code to get items for the three dropdowns:
Concurrent(
ClearCollect(collectStatusFilter, {Result: "Alle"});Collect(collectStatusFilter,(Distinct(Filter('Equipment List',ItemStatus <> Blank() && Plant = myPlant),ItemStatus))),
ClearCollect(collectCategoryFilter, {Result: "Alle"});Collect(collectCategoryFilter,(Distinct(Filter('Equipment List', Category <> Blank() && Plant = myPlant),Category ))),
ClearCollect(collectDepartmentFilter, {Result: "Alle"});Collect(collectDepartmentFilter,(Distinct(Filter('Equipment List', Department <> Blank() && Plant = myPlant),Department)))
)
I did make the ideal situation work using a lot of if-sentences to overwrite existing collection based on the inputs. But due to the many amounts of if's and I assume the ClearCollect part of each if, the app took ages to load (did work fine when it finally finished loading though).
This is the code from one of my dropdowns at the moment:
SortByColumns(collectDepartmentFilter,"Result",Ascending)
Does anyone know a solution to my problem? 🙂