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 :
Power Platform Community / Forums / Power Apps / Gallery Filter Not Wor...
Power Apps
Unanswered

Gallery Filter Not Working As Expected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi! I have a gallery which I have applied 3 filters to.

 

The filters work fine until I reset the filters (via the red cross). I can't get them to work unless I try to use the filters and then they wake up.

 

Looking at the below code, I have covered off the scenario where if one if blank, filter by the other two, but I haven't covered the scenarios where is 2 are blank, filter by the one in use. Am I correct?

 

Gallery Code:

If(Dropdown1_1.Selected.Value = "Select" And IsBlank(SearchTicket.Text) And IsBlank(SearchEntity), 'Reactive Support Escalations', //all blank

If(Dropdown1_1.Selected.Value = "Select",
Filter('Reactive Support Escalations', SearchTicket.Text in Title And SearchEntity.Text in 'Entity'), //If Status Blank, filter Search text x2

If(IsBlank(SearchTicket.Text),
Filter('Reactive Support Escalations', 'Status Text' = Dropdown1_1.Selected.Value And SearchEntity.Text in 'Entity'),

If(IsBlank(SearchEntity.Text),
Filter('Reactive Support Escalations', 'Status Text' = Dropdown1_1.Selected.Value And SearchTicket.Text in Title),

Filter('Reactive Support Escalations', 'Status Text' = Dropdown1_1.Selected.Value And SearchTicket.Text in Title)))))

 

Reset Button Code:

Reset(Dropdown1_1); Reset(SearchTicket); Reset(SearchEntity)

 

No Filters Applied

s_tanswell84_0-1704811983138.png

 

One Filter In Use After Reset

s_tanswell84_1-1704812138002.png

 

Same Filter In Use After I have Tried the Other 2 (and not press reset)

s_tanswell84_3-1704812190529.png

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,496 Super User 2025 Season 2 on at
    Re: Gallery Filter Not Working As Expected

    Hi @s_tanswell84 ,

     

    I tried simplifying your formula. Can you try this to see if it does produce the desired result?

    Filter(
    	'Reactive Support Escalations',
    	Dropdown1_1.Selected.Value = "Select" || 'Status Text' = Dropdown1_1.Selected.Value,
    	IsBlank(SearchTicket.Text) || SearchEntity.Text in 'Entity',
    	IsBlank(SearchEntity) || SearchTicket.Text in Title
    )

     

    It should be noted that this formula is not delegable, so will cause issues if you have more items in your data source than the data row limit.

  • OdinDelToro Profile Picture
    407 on at
    Re: Gallery Filter Not Working As Expected

    Hello @s_tanswell84,

     

    You can use the following approach to filter the gallery.

    If(
     And(
     Dropdown1_1.Selected.Value = "Select",
     IsBlank(SearchTicket.Text),
     IsBlank(SearchEntity.Text)
     ),
     'Reactive Support Escalations',
     Filter(
     'Reactive Support Escalations',
     And(
     Or(
     Dropdown1_1.Selected.Value = "Ongoing",
     Dropdown1_1.Selected.Value = "Completed"
     ),
     Or(
     IsBlank(SearchTicket.Text),
     StartsWith(
     Title,
     SearchTicket.Text
     )
     ),
     Or(
     IsBlank(SearchEntity.Text),
     StartsWith(
     'Entity',
     SearchEntity.Text
     )
     )
     )
     )
    )

     

    In the case you would like to include all type of filters including the "Select" for the 'Status Text'  in the Dropdown change that section. 

    If(
     And(
     Dropdown1_1.Selected.Value = "Select",
     IsBlank(SearchTicket.Text),
     IsBlank(SearchEntity.Text)
     ),
     'Reactive Support Escalations',
     Filter(
     'Reactive Support Escalations',
     And(
     Dropdown1_1.Selected.Value = 'Status Text' ,
     Or(
     IsBlank(SearchTicket.Text),
     StartsWith(
     Title,
     SearchTicket.Text
     )
     ),
     Or(
     IsBlank(SearchEntity.Text),
     StartsWith(
     'Entity',
     SearchEntity.Text
     )
     )
     )
     )
    )

     

    Regarding the Reset function for the icon, you can set a context variable within the screen.

    In the OnVisible property of the screen use 

    UpdateContext({locResetFilters:false})

    Then on the OnSelect property of the icon use 

    UpdateContext({locResetFilters:true})

     Last, on the Dropdown1_1, SearchTicket and SearchEntity controls on the Reset property include 

    locResetFilters

     

    Hope this helps clarify the doubt, let me know in case you're still facing an issue within it.

    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.

  • s_tanswell84 Profile Picture
    Microsoft Employee on at
    Re: Gallery Filter Not Working As Expected

    Thanks @BCBuizer - that didn't work I'm afraid. I get the same result

  • s_tanswell84 Profile Picture
    Microsoft Employee on at
    Re: Gallery Filter Not Working As Expected

    Thanks @OdinDelToro - that didn't work I'm afraid. The dropdown does filter but the filter fields don't reset and the text filters don't filter the gallery

  • BCBuizer Profile Picture
    22,496 Super User 2025 Season 2 on at
    Re: Gallery Filter Not Working As Expected

    Hi @s_tanswell84,

     

    Can you then please share how the reset mechanism works? What is in the OnSelect property of the red cross? Are any variables involved?

  • OdinDelToro Profile Picture
    407 on at
    Re: Gallery Filter Not Working As Expected

    Hello @s_tanswell84

     

    Are the text filters a text input control?

     

    For the Default property of the dropdown do you have it set to Select as default?

    OdinDelToro_0-1704828372103.png

     

    For the Ticket number and Entity text boxes the Default have to be empty and you have to assigned the variable on the Reset function.

    OdinDelToro_1-1704828463658.png

    OdinDelToro_2-1704828490653.png

     

    Now regarding the filters not applied for the text boxes, can you validate that the name of the Ticket number and entity columns in the datasource match within the formula. 

    OdinDelToro_3-1704828855199.png

     

    Is there any error highlighted within the formula? Can you share it if there is any please? Thank you

  • s_tanswell84 Profile Picture
    Microsoft Employee on at
    Re: Gallery Filter Not Working As Expected
    Hi! Default Values: - DropDown: "1" - Text Input 1: blank - Text Input 2: blank Reset: All set to locResetFilters Column names match
  • s_tanswell84 Profile Picture
    Microsoft Employee on at
    Re: Gallery Filter Not Working As Expected

    The Red Cross OnSelect is: Reset(Dropdown1_1); Reset(SearchTicket); Reset(SearchEntity)

  • OdinDelToro Profile Picture
    407 on at
    Re: Gallery Filter Not Working As Expected

    Hello @s_tanswell84,

     

    Thank you for the information. If it's not working the variable approach, you can keep the previous way you had on the reset button code. Please, remove the variable from the onvisible property of the screen, from the onselect property of the icon and also remove it from the reset property of the dropdown and the two text input controls. 

    Then just include in the icon onselect property 

    Reset(Dropdown1_1);Reset(SearchTicket);Reset(SearchEntity);

     

    Now, regarding text inputs not filtering the gallery. What are the filters you're applying within the dropdown and the text inputs? How are the dropdown values been populated coming from the 'Status Text' column? Is it a simple text column or a choice column?

     

    For the text inputs, within the formula we're using the StartsWith function which filters based on the characters typed considering the start. So for example, if you type on the ticket number 1023 it will filter the tickets that starts with 1023 within the Title column. Same logic for the entity.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard