I have a gallery which displays the contents of a SP online Document Library ("Documents"). I have a dropdown box ("DropDown1") which allows selection of a department and this dropdown is populated from a Collection ("Departments"). I have a TextSearchBox ("TextSearchBox1").
I want to display all items in the gallery until:
- A user inputs text into TextSearchBox1 - this should then search the "Name" Column of "Documents"
- A user makes a selection from "DropDown1" which will filter against the "Department" column of "Documents"
These two actions need to be independant of each other, that is to say that a search will result in returns regardless of whether or not the dropdown has had a selection made and the filter should return results whether or not the search box has text in it.
My current code is as follows:
SortByColumns(Search(Filter('Site Content Templates',Deptartment=Dropdown1.SelectedText.Value),
TextSearchBox1.Text,
"{Name}","Department"),"{Name}",If(SortDescending1, Descending, Ascending))
There are two issues with this:
- It doesn't show all items as default
- as a result of point 1, the search function only works if the dropdown has a selection.
I'm fairly new at all of this and really need some assistance to make this work.
Thansk very much for your assistance.

Report
All responses (
Answers (