Hello Guys,
I have a Gallery (Software-Store) which is filterd by 2 DropDown Menus and a search Text
DropDown Department : SIngle Choice Column (Values filled with a Collection [Empty Value added])
DropDown Category: Multiple Choice Column ( Values filled with a Collection [Empty Value added])
Now I filter my Gallery with the following code
If(
IsBlank(Dropdown_Department_Software.Selected.Value),
/* If DropDown for Department is NULL */
If(
IsBlank(Dropdown_Category_Software.Selected.Value),
/*If DropDown Category is NULL only search for text*/
Filter(
'Software-Liste',
StartsWith(
Title,
TextInput_Search_Software.Text
)
),
/*If DropDown Categorie is Selected, Search for Text and Category*/
With(
{
data: Filter(
'Software-Liste',
StartsWith(
Title,
TextInput_Search_Software.Text
)
)
},
Filter(
data,
Dropdown_Category_Software.Selected.Value in Kategorie.Value
)
)
),
/* Check for Category Dropdown */
If(
IsBlank(Dropdown_Category_Software.Selected.Value),
/*If DropDown Category is NULL*/
Filter(
'Software-Liste',
StartsWith(
Title,
TextInput_Search_Software.Text
) && Abteilung.Value = Dropdown_Department_Software.Selected.Value
),
/*If DropDown Category also have a Value Selected*/
With(
{
data: Filter(
'Software-Liste',
StartsWith(
Title,
TextInput_Search_Software.Text
)
)
},
Filter(
data,
Dropdown_Category_Software.Selected.Value in Kategorie.Value && Abteilung.Value = Dropdown_Department_Software.Selected.Value
)
)
)
)
Why the with?
I know there only like 4 Options in the Category Choices and overall just 50-70 Software. We all know, Filtering with Multiple Choice runs into a delegtion Warning because in isn't delegatable (in this use)
for this, I used with to preprepare Data and Filter the Category afterwards. Not
beautiful but it Works (If it's stupid but it works, it ain't stupid 😉)
My question is, is there a more simple way to achieve my needs without that IF Construct?