cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
azbilly
Regular Visitor

search bar and filter button

Hello- I am trying to build a glossary of terms for work. I currently set up a search box for the gallery, but I cannot figure out how to attach a letter navigation to it at buttons to filter out to just the rows that have a specific letter in a column on my sharepoint list. Looking to make them buttons for A-Z. my current gallery items is set to: Search('Test Glossary List', 'Search Box'.Text, "Title", "Definition") 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @azbilly ,

 

To make Gallery show all items by default, set OnStart/OnVisible property: Set(Var_Letter, "");Set(Var_Search, "")

To rest the gallery:

1. Set OnChange property of search text box: Set(Var_Search,'Search Box'.Text)

2. Modify Items property of Gallery: 

 

 

Filter(Search('Test Glossary List', Var_Search, "Title", "Definition"), StartsWith(Title,Var_Letter))

 

 

3. Add a Rest button, set OnSelect property: Set(Var_Letter, "");Set(Var_Search, "");Reset('Search Box')

Test Result:

GIF_45.gif

Sik

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @azbilly ,

Is that a Delegation error you can see?

Do the fields start with the letter or is it anywhere in them.

If starting - you can try

Filter(
   'Test Glossary List', 
   StartsWith(
      Title,
      'Search Box'.Text
   ) ||      //I assume you want OR here
   StartsWith(
      Definition,
      'Search Box'.Text
   )
)

Please advise if this is your situation.

 

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.

Do I apply that to the gallery items? If so, what do I apply to each letter's button? Currently I have the search box functionality working to search based off the title and definition. In addition to that functionality, I want to add a singular button for each letter (A-Z) to filter to only the words that start with that letter in the title field. So really hoping for both options to work in tandem together. 

Hi @azbilly ,

With the code I supplied below

Filter(
   'Test Glossary List', 
   StartsWith(
      Title,
      'Search Box'.Text
   ) ||      //I assume you want OR here
   StartsWith(
      Definition,
      'Search Box'.Text
   )
)

if the user types an a in ‘Search Box’, the gallery will automatically filter to items in EITHER Title OR Definition starting with a.

As an added bonus, if you set the Default of ‘Search Box’ to “” (empty string), all the items will display until the user types something in. Also multiple letters can be used so man  will get everything starting with this.

 

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.

 

v-siky-msft
Community Support
Community Support

Hi @azbilly 

 

We can use Variable to pass the selected button letter and apply it to Gallery Items code. Please check this:

1. Add 24 buttons from A-Z

2. Set OnSelect property of each letter button to pass their letter to Variable.

Set(Var_Letter, "A")

Set(Var_Letter, "B")

...

Set(Var_Letter, "Z")

3. Modify Gallery Items property:

 

Filter(Search('Test Glossary List', 'Search Box'.Text, "Title", "Definition"), StartsWith(Title,Var_Letter))

 

 

Snipaste_2020-03-10_10-01-32.png

Hope this helps.

Sik

WarrenBelz
Super User
Super User

HI @azbilly ,

A couple of possibilities here. Please tag whichever one suits your needs to continue this thread.

@v-siky-msft - This is exactly what I am looking for! Thank you! Can I ask to expand on it though and how I would right it up with a rest button to show all listed items again? AND is there a way to set the default to show all items in the list until a button is selected? Thank you so much!!

Hi @azbilly ,

 

To make Gallery show all items by default, set OnStart/OnVisible property: Set(Var_Letter, "");Set(Var_Search, "")

To rest the gallery:

1. Set OnChange property of search text box: Set(Var_Search,'Search Box'.Text)

2. Modify Items property of Gallery: 

 

 

Filter(Search('Test Glossary List', Var_Search, "Title", "Definition"), StartsWith(Title,Var_Letter))

 

 

3. Add a Rest button, set OnSelect property: Set(Var_Letter, "");Set(Var_Search, "");Reset('Search Box')

Test Result:

GIF_45.gif

Sik

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!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,388)