web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter data source usi...
Power Apps
Answered

Filter data source using 2 search fields

(1) ShareShare
ReportReport
Posted on by 19

I'm trying to filter my gallery by 2 different items.

Here is the code: (the user can type into search text box to filter on any of the fields in qoutes)

SortByColumns(Search('[dbo].[Pharmacy]',TextSearchBox1.Text,"PharmacyName","BdcOwner","ConsultantOwner","City","State","ZIPCode","NPI","StreetAddress"),"PharmacyName",Descending)

 

BUT, I need to integrate a filter on the entire data set regardless of what they search for.

&& Search('dbo.Pharmacy',"0",SuppressInd)

This is to look at the SuppressInd column, which contains a 1 or 0, and only display those records that are not suppressed.

Right now, i get errors.

 

Can anyone find a way to integrate the 2?

 

Thank you!

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    The Search function returns a "table" with the records filtered by the condition you passed. You can nest multiple search calls in the same expression, searching on the result of another search call:

    SortByColumns(
     Search(
     Search('dbo.Pharmacy',"0",SuppressInd),
     TextSearchBox1.Text,
     "PharmacyName",
     "BdcOwner",
     "ConsultantOwner",
     "City",
     "State",
     "ZIPCode",
     "NPI",
     "StreetAddress"),
     "PharmacyName",
     Descending)

     If the column "SuppressInd" contains only the values 0 or 1, you can also use a Filter expression:

    SortByColumns(
     Search(
     Filter('dbo.Pharmacy', SuppressInd = "0"),
     TextSearchBox1.Text,
     "PharmacyName",
     "BdcOwner",
     "ConsultantOwner",
     "City",
     "State",
     "ZIPCode",
     "NPI",
     "StreetAddress"),
     "PharmacyName",
     Descending)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard