Hi,
in my app I have a gallery with data from a sharepoint list. For sorting and filtering I have created a search box and two dropdown fields as filters like in this video: https://www.youtube.com/watch?v=6KlI1iZ_KD0.
This is the list:

This is the gallery:

This is the code:
SortByColumns(
Filter(
'SharePoint List';
Or(
Suchleiste.Text in Gegenstand;
Suchleiste.Text in Kürzel
) && (Kategorie.Value = DropdownKategorie.Selected.Value || DropdownKategorie.Selected.Value = Blank()) && (Aufbewahrung.Value = DropdownAufbewahrung.Selected.Value || DropdownAufbewahrung.Selected.Value = Blank ())
);
"field_3"
)
This works perfectly fine. Right now it is sorted by the "Kürzel" column (The inernal name is "field_3").
But I would like to sort it first by the column "Kategorie" (internal name "field_2") with a custom order and then by "Kürzel. My problem is that "Kategorie" is an option field and I cannot just replace "field_3" with "field_2" in the code above.
I tried the AddColumn function:
SortByColumns(AddColumns('SharePoint List'; "KategorieSuche"; Kategorie.Value); "KategorieSuche";["Kamera"; "Audio"; "Licht"; "Grip"])
This code works on its own but not in conjunction with the code above.
Chaining with ";;" does not work either:
AddColumns('SharePoint List'; "KategorieSuche"; Kategorie.Value);;
SortByColumns(
Filter(
'SharePoint List';
Or(
Suchleiste.Text in Gegenstand;
Suchleiste.Text in Kürzel
) && (Kategorie.Value = DropdownKategorie.Selected.Value || DropdownKategorie.Selected.Value = Blank()) && (Aufbewahrung.Value = DropdownAufbewahrung.Selected.Value || DropdownAufbewahrung.Selected.Value = Blank ())
);
"KategorieSuche";["Kamera"; "Audio"; "Licht"; "Grip"]
)
How can I merge these two functions so that I can sort by "Kategorie" while maintaining the filter?
I would be very grateful for any help!
Elias