cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
scutiyog
Level: Powered On

Glossary of terms with search and letter filtering

Hi all,

I am trying to build a glossary of terms powerapp.  Basically I have a SharePoint list (VGTGlossary) with Term and Definition and Alpha - which is a calculated column grabbing the first letter of each term.

On the power app I have a horizontal gallery (LetterNav) set to the SP list and it's Items are set to - Sort(Distinct(VGTGlossary,Alpha),Result,Ascending)

 

I have a 2nd gallery (Glossary) where the Terms will show.

 

I have also added a text input to the page to act as a search - Searchbox

 

Now if i set the Glossary gallery to - Search(VGTGlossary,Searchbox.Text,"Title", "Definition") this works great - the Glossary gallery can be scrolled through or if the user starts typing in the search box, it will filter the Glossary accordingly.  I even added a reset button next to the search box to clear it out to reset the Glossary for continuous scrolling

If I set the Glossary gallery to - SortByColumns(Filter(VGTGlossary, StartsWith(Term, LetterNav.Selected.Result)), "Title", Ascending) it works that if a user clicks on a letter in the LetterNav, the glossary gallery filters accordingly.

 

I can't seem to figure out how to have both be usable so that if a user uses the searchbox, it filters the Glossary Gallery, but also if a user clicks a letter it will filter the Glossary gallery as well.

I was trying an IF function along the lines of

 

If(IsBlank(Searchbox.Text),SortByColumns(Filter(VGTGlossary,StartsWith(Term, LetterNav.Selected.Result)),"Title",Ascending),Search(VGTGlossary,Searchbox.Text,"Title")

 

But that then throws errors on each of the components in the Glossary Gallery saying that ThisItem.Definition/Term Name isn't valid.

 

Bottom line - i'm trying to combine a search and a click filter on a gallery so that if a user clicks a letter it filters the gallery but if they use a search box it will search the whole gallery (basically overwrites the letter filter)

 

Hope this made sense!

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Glossary of terms with search and letter filtering

Hi @scutiyog ,

 

That seems you miss a ")" in the end of the formula.

Please try this:

If(IsBlank(Searchbox.Text), SortByColumns(Filter(VGTGlossary,StartsWith(Term, LetterNav.Selected.Result)),"Title",Ascending),Search(VGTGlossary,Searchbox.Text,"Title"))

Best regards,

Sik

View solution in original post

2 REPLIES 2
v-siky-msft
Level 10

Re: Glossary of terms with search and letter filtering

Hi @scutiyog ,

 

That seems you miss a ")" in the end of the formula.

Please try this:

If(IsBlank(Searchbox.Text), SortByColumns(Filter(VGTGlossary,StartsWith(Term, LetterNav.Selected.Result)),"Title",Ascending),Search(VGTGlossary,Searchbox.Text,"Title"))

Best regards,

Sik

View solution in original post

scutiyog
Level: Powered On

Re: Glossary of terms with search and letter filtering

That worked!  Thanks so much, I knew it had to be something silly 🙂

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,575)