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

Filter a gallery via Dropdown and be able to search

So I'm trying to build a supplier approval app. I'd like to be able to filter the gallery by the approval status of a supplier which is set to a text field and then be able to search by supplier name. I'm trying to impliment the following solution based on other answers I've found here and on the web, but I get an unexpected operator error, can someone direct me to where I'm going wrong?

SortByColumns(
     Search(
         Filter(Suppliers, "XXXXX_supplierstatus"=Dropdown1.Selected.Value) 
    TextSearchBox1.Text, "XXXXX_suppliername", "XXXXX_supplierstatus"),
"XXXXX_suppliername", If(SortDescending1, Descending, Ascending))
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter a gallery via Dropdown and be able to search

@DevinFlickinger 

 

See if this helps:

SortByColumns(
   Search(
            Filter(Suppliers, XXXXX_supplierstatus=Dropdown1.Selected.Value),         TextSearchBox1.Text, "XXXXX_suppliername", "XXXXX_supplierstatus"),
"XXXXX_suppliername", If(SortDescending1, Descending, Ascending))

Not sure your dataSource type (i.e. SQL, SharePoint, Excel, etc), but you most likely don't need the quotes around the XXXXX_supplierstatus in your filter.  Also, you were missing a comma in your formula.

Beyond that - your formula should give you want you want with the corrections above.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Filter a gallery via Dropdown and be able to search

@DevinFlickinger 

 

See if this helps:

SortByColumns(
   Search(
            Filter(Suppliers, XXXXX_supplierstatus=Dropdown1.Selected.Value),         TextSearchBox1.Text, "XXXXX_suppliername", "XXXXX_supplierstatus"),
"XXXXX_suppliername", If(SortDescending1, Descending, Ascending))

Not sure your dataSource type (i.e. SQL, SharePoint, Excel, etc), but you most likely don't need the quotes around the XXXXX_supplierstatus in your filter.  Also, you were missing a comma in your formula.

Beyond that - your formula should give you want you want with the corrections above.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

DevinFlickinger
Level: Powered On

Re: Filter a gallery via Dropdown and be able to search

@RandyHayes  YOU ARE MY FREAKING HERO! This has been driving me NUTS!
My data source is Common Data Service, we've been pushing to aggregate our data all under one place
Final formula:

SortByColumns(
     Search(
         If(Dropdown1.Selected.Value = "All", Suppliers, Filter(Suppliers, XXXXX_supplierstatus=Dropdown1.Selected.Value)),
    TextSearchBox1.Text, "XXXXX_suppliername"),
"XXXXX_suppliername", If(SortDescending1, Descending, Ascending))

Works like a freaking charm, hopefully PowerApps will get better error handling in the future to help save me from myself, HA!

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: 188 members 6,644 guests
Please welcome our newest community members: