cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lukas1
Advocate II
Advocate II

Conditionally Filter Gallery Items by Search-Criteria

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

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

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Pstork1
Dual Super User III
Dual Super User III

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

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (66,812)