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

Community site session details

Session Id : h5MvZQToaB6705yA+fyxm+
Power Apps - Building Power Apps
Answered

Conditionally Filter Gallery Items by Search-Criteria

Like (0) ShareShare
ReportReport
Posted on 18 Oct 2019 10:20:36 by 190

Hi,

I have a gallery which shows a list of equipments at a certain location and a text-field "Search_Serial". If the text-field is empty the gallery should show all equipments of the selected location. If the text-field is not empty the items in the gallery should be filtered by location AND the text-field content:

If(
 IsBlank(Search_Serial.Text);
 Filter(
 Equipments_Offline;
 Location = Text(Gallery2_3.Selected.ID)
 );
 Filter(
 Equipments_Offline;
 Location = Text(Gallery2_3.Selected.ID) && Search_Serial.Text in Serialnumber
 )
)

Problem:

If I enter any text in the text-field nothing will be shown in the gallery. I even tried to filter by the location only for both conditions:

If(
 IsBlank(Search_Serial.Text);
 Filter(
 Equipments_Offline;
 Location = Text(Gallery2_3.Selected.ID)
 );
 Filter(
 Equipments_Offline;
 Location = Text(Gallery2_3.Selected.ID)
 )
)

The rseult is the same: No gallery items are shown if the text-field is not empty.

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    67,961 Most Valuable Professional on 18 Oct 2019 at 12:08:34
    Re: Conditionally Filter Gallery Items by Search-Criteria

    In the documentation for IsBlank() there is the following entry...

    To test specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.

     

    So try the following for your If statement and see if it helps.

    If(
     Search_Serial.Text = Blank();
     Filter(
     Equipments_Offline;
     Location = Text(Gallery2_3.Selected.ID)
     );
     Filter(
     Equipments_Offline;
     Location = Text(Gallery2_3.Selected.ID) && Search_Serial.Text in Serialnumber
     )
    )

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 982 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 396 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 356

Last 30 days Overall leaderboard
Loading complete