cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bradcarmichael
Level: Power Up

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

prajyot
Level 8

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

bradcarmichael
Level: Power Up

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

bradcarmichael
Level: Power Up

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

prajyot
Level 8

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
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
Users Online
Currently online: 93 members 4,952 guests
Please welcome our newest community members: