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

Filter Gellery Then By Text Search

Hi,

I have a gallery that filters my suppliers by there supplier code which works fine. I now need to add a search bar to my gallery so i can filter for individual invoices. 

 

I am using the following code but its not showing results. 

 

SortByColumns(Filter('Supplier Invoices',Title=Gallery2_16.Selected.'Supplier ID' && 'Invoice Number'=Search_1.Text),"ReceivedDate",Descending)

 

Any helps is appreciated.  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter Gellery Then By Text Search

Hi @Barber_Chris ,

Your text is valid if all the control references are.

Try this first - make the Default of Search1 (I assume this is the name of your Text Control) "" (two double quotes or an empty string), then put this in the Items of the Gallery

SortByColumns(
   Filter(
      'Supplier Invoices',
	  Title=Gallery2_16.Selected.'Supplier ID' && 
	  StartsWith('Invoice Number',Search_1.Text)
   ),
   "ReceivedDate",
   Descending
)

and see what happens when you start typing text (you should see all results filtered on Title before 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.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Filter Gellery Then By Text Search

Hi @Barber_Chris ,

Your text is valid if all the control references are.

Try this first - make the Default of Search1 (I assume this is the name of your Text Control) "" (two double quotes or an empty string), then put this in the Items of the Gallery

SortByColumns(
   Filter(
      'Supplier Invoices',
	  Title=Gallery2_16.Selected.'Supplier ID' && 
	  StartsWith('Invoice Number',Search_1.Text)
   ),
   "ReceivedDate",
   Descending
)

and see what happens when you start typing text (you should see all results filtered on Title before 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.

View solution in original post

Highlighted
Helper III
Helper III

Re: Filter Gellery Then By Text Search

That worked a treat, thanks!

 

If i wanted to search more columns from the same search box how could i modify it?

 

Regards,

Chris

Highlighted
Super User
Super User

Re: Filter Gellery Then By Text Search

Hi @Barber_Chris ,

SortByColumns(
   Filter(
      'Supplier Invoices',
      Title=Gallery2_16.Selected.'Supplier ID' && 
      (   
         StartsWith('Invoice Number',Search_1.Text) ||
         StartsWith(YourOtherField,Search_1.Text)
      )
   ),
   "ReceivedDate",
   Descending
)

Helpful resources

Announcements
secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

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 (3,473)