cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Button search/filtering of gallery in addition to standard text search

Hi all,

 

Apologies if this is a basic question, I am pretty new to powerapps and I have been given the task of tweaking the UI of a prototype app that was put together by another team member. Basically this is intended to be a Contacts app that has a list of all of our staff with their names, email addresses, contact numbers, divisions, etc pulled from a sharepoint data source.

 

At the moment the text search works fine with no issues, however I have also introduced a vertical navigation bar that is made up with 26 buttons representing each letter of the alphabet. The idea is that if a user taps say the letter B that the gallery will automatically filter to show all names entries that start with the letter B.

 

I spent some time playing around with trying to make some differrent functions works on the OnSelect section on a button. An example is as follows on a button object called VertNaviB that has a text value of B defined:   

 

Filter(Contacts, StartsWith(Title, VertNaviB.Text))

 

From what I understand, Title is linked to the name column in the sharepoint data source. Other variations of the above did not appear to trigger anything in the gallery object as well.

 

I have been reading/watching support material further and I am thinking that I need to modify the search/filter function on the Gallery itself with additional conditions? I am just not sure how to go about it or if my thinking is correct. Below is what is currently in place on the Gallery object:

 

SortByColumns(

Search(

Contacts, TextSearchBox.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))

 

Long story short, I want to maintain the type search functionality for users and also have the alphabetical filtering as well as an alternative search option.

 

Cheers,

 

Brad

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: Button search/filtering of gallery in addition to standard text search

Hi @bradcarmichael 

 

SortByColumns(Search(Filter(Contacts,StartsWith(Title, VertNaviB.Text)) ,TextSearchBox.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Resolver II
Resolver II

Re: Button search/filtering of gallery in addition to standard text search

Hello ,

Try below formula for 'B' button onselect.

 

Sort(Filter(Contacts, StartsWith(Title,TextSearchBox.Text)) , Title)

Thanks,
Prajyot M

Highlighted
New Member

Re: Button search/filtering of gallery in addition to standard text search

Hi Reza,

 

Thank you for your response. The Gallery does end up automatically sorting to show all contacts starting with B when I launch the app, however I want this sorting to only kick in when the B navigation button is pressed (eg: VertNaviB) for instance. And then all contacts to sort by C when VertNaviC button is pressed and so forth.

 

Do you have any other suggestions?

 

Cheers,

 

Brad

Highlighted
New Member

Re: Button search/filtering of gallery in addition to standard text search

Hi Prajyot,

 

Thank you for your response, unfortunately nothing appears to happen when the B button is pressed when that formula is added to the onselect of that button.

 

Do you have any other suggestions?

 

Cheers,

 

Brad

Highlighted
Resolver II
Resolver II

Re: Button search/filtering of gallery in addition to standard text search

Sort(Filter(Contacts, StartsWith(Title,TextSearchBox.Text),"ID", If(SortDescending1, Descending, Ascending)) , Title)

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,671)