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 Gallery - my br...
Power Apps
Unanswered

Filter Gallery - my brain can't work out the logic

(0) ShareShare
ReportReport
Posted on by

Hi,

Another missing piece of the jigsaw in my App

I have a simple Collection that I want the user to search. So I've created a gallery and two fields. SearchAll (Text control) and cbsearcharea (combobox)

 

So I have a filter of the collection, but I can't get the logic to work how I want it

If SearchAll finds matches in The Title/Description/ID, then show values

If cbsearcharea matches values, then show values

if cbsearcharea & searchall is used, the results of cbsearcharea need to be filtered by searchall

 

 

Filter(
 ColSearchRequests,
 IsBlank(SearchAll.Text) || SearchAll.Text in Name || SearchAll.Text in 'RIPS ID' || SearchAll.Text in Description,
 Service in cbsearcharea.SelectedItems
)

 

This isn't working...it does the combobox & text, but text on it's own isn't showing

 

My brain can't work out how to write the correct logic..

Thanks

Steven

Categories:
  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @steshepherd,

     

    Try this out:

     

    Filter(
     ColSearchRequests,
     IsBlank(SearchAll.Text) || SearchAll.Text in Name || SearchAll.Text in 'RIPS ID' || SearchAll.Text in Description,
     IsBlank(Dropdown1.Selected.Value) || Dropdown1.Selected.Value in Text(Service)
    )

     

     

    I am using a dropdown control instead of a combobox.

     

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

     

  • Geeks_D Profile Picture
    1,169 on at
    Filter(
     ColSearchRequests,
     Or(StartsWith(Name, SearchAll.Text), StartsWith(Description, SearchAll.Text), StartsWith(Service.Value,cbsearcharea.Selected.Value))
    
    ​

    Use the StartsWith with an Or 
    That will check both controls if you are using a dropdown control
    If you are using a combobox it will be diff

  • steshepherd Profile Picture
    on at

    Hi

    Yeah, I'm using a combo - trying to be helpful to the users

    Not sure about this:

    Dropdown1.Selected.Value in Text(Service)

    What's the Text(Service) doing? Doesn't that just turn Service into a Text?

    Service is what is in the combobox

    Filter(
     ColSearchRequests,
     IsBlank(SearchAll.Text) || SearchAll.Text in Name || SearchAll.Text in 'RIPS ID' || SearchAll.Text in Description,
     IsEmpty(cbsearcharea.SelectedItems) || Service in cbsearcharea.SelectedItems
    )

    This almost works - the only problem is the Text only search doesn't work (when the combox is empty)

  • steshepherd Profile Picture
    on at

    Hi - yes, I'm using combobox. I'm also wanting to search the whole text not StartsWith

     

    Could that be the same (using your Or) using Search instead?

  • steshepherd Profile Picture
    on at

    Hi

    Still struggling to get the results I am looking for

    These are the scenarios (I will just say 'true' for the filter results being found in the gallery to make life easier)

    1. Combobox values + Textbox empty - true
    2. Combobox values + Textbox values - true
    3. Combobox empty + Textbox empty - false
    4. Combobox empty + Textbox values - true

     

    The code above works for 1, 2, 3 but not 4

    Here are some screenshots

    Scenario 1 - tick! (this works for multi-values too)

    steshepherd_1-1696584818350.png

    Scenario 2 - tick!

    steshepherd_2-1696584868495.png

    Scenario 3 - tick!

    steshepherd_0-1696584756740.png

    Scenario 4 - 😞

    steshepherd_3-1696584913361.png

    Any help?

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard