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

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

11 REPLIES 11
WarrenBelz
Super User
Super User

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.

 

AsanKani
Helper V
Helper V

@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.

AsanKani
Helper V
Helper V

@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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,786)