Hi everyone,
I am trying to include a search bar to search my gallery, which is currently populated by a collection.
Right now, I am populating my gallery successfully as follows: If Field1DropDown is not blank, filter Collection on Field1=Field1DropDown.Selected.Result. If Field1DropDown is blank, make my gallery blank.
I am sorting my gallery by "ID" field and using a context variable SortDescending to determine whether my gallery is sorted descending or ascending.
Here is my current gallery Items property which works great:
SortByColumns(
If(
!IsBlank(Field1DropDown.Selected.Result),
Filter(
Collection,
Field1=Field1DropDown.Selected.Result
),
Blank()
),
"ID",
If(
SortDescending,
Descending,
Ascending
)
)
Everything falls when I try to add in my search bar functionality using StartsWith(). I know the basic structure should be something like:
SortByColumns(
If(
IsBlank(SearchBar.Text),
.....everything I had before with my Filter statement etc....),
StartsWith(Field1, SearchBar.Text))),
...everything I had before with "ID" and SortDescending etc....
)
)
But for the life of me I cannot figure out the syntax. Probably something with parentheses, I'm not quite sure. If anyone has any advice here, I'd appreciate it so much! Thanks in advance.