cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Adding a Search Bar to a Gallery

Is it possible to add a Search Bar that can search all Data within the Gallery.

For instance, if I search 'Open' it would provide me with listings of any item that has the word Open within it?

9 REPLIES 9
Super User III
Super User III

Hi @kevtun1982 ,

You actually search In the Items of the Gallery. Note that Search() is not Delegable, so you will get a Delegation warning and this will not work on data sets larger than your Delegation (500-2000) limit.

Search(
   Filter(
      YourListName,
      --- your gallery filter here ---
   ),
   "YourSearchBoxName.Text",
   "Listings"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Resolver I
Resolver I

@WarrenBelz 

I am not 100% sure what you mean. I currently have code within my 'Items' of the Gallery. This is for some dropdown filters that I have.

I was hoping to add a search bar also. I am not a coder and I wouldn't know where to add the code you have provided.

Resolver I
Resolver I

@kevtun1982  Gallery Items Property to use below formulae

 

 

If(IsBlank(TextInput_Search.Text),DataSource,  Filter(DataSource,StartsWith(Column,TextInput_Search.Text)))

 

 

 TextInput_Search.Text is using for Search Text


Did this post solve your problem? Please click Accept as Solution so that others may find it more quickly.
If you liked my response, please give it a Thumbs Up.

Hi @kevtun1982 ,

What are the current Items of the gallery?

Hi @WarrenBelz 

I have provided a snip of everything in the gallery. It is the same Gallery that I added the dropdown menu to.

 

powerapps12.png

@kevtun1982 ,
I simply want the Items property of the Gallery (please provide it in Text) as you have not given this to date. I will then add the search syntax for you. Can you also provide the name of your Search Text box and confirm the field it is searching is Listings.

Hi @WarrenBelz 

I am really sorry. I probably sound pretty dumb to you. This is entirely my first time messing with code.

 

So the Items property of the gallery is;

 

If(
StatusDropdown.SelectedText.Value="All",
NewNCR,
If(
CategoryDropdown.SelectedText.Value="All",
Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value),
Filter(NewNCR, Status.Value = StatusDropdown.SelectedText.Value && Category.Value = CategoryDropdown.SelectedText.Value)
)
)

 

The search box is simply 'SearchBox1'

 

I was hoping that it could search all fields within the Gallery. I am trying to make it easy for the users to search for a word and for it to load anything with that word in it.

 

Is this possible?

 

Kevin

Hi @kevtun1982 ,

Note that Search() is not Delegable, so you will get a Delegation warning on this

Search(
   Filter(
      NewNCR,
      (
         StatusDropdown.Selected.Value="All" || 
         Status.Value = StatusDropdown.Selected.Value
      ) &&
      (
         CategoryDropdown.SelectedText.Value="All" || 
         Category.Value = CategoryDropdown.Selected.Value
      )
   ),
   SearchBox.Text,
   "Listings",
   "OtherField1",
   "OtherField2"
)

 Replace your other fields on the last two and add any more.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (61,109)