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 / Filtering A Gallery By...
Power Apps
Answered

Filtering A Gallery By A Wildcard

(0) ShareShare
ReportReport
Posted on by 71

Hey everyone,
I have a gallery with 7 fields in it.  I want to be able to filter it by the 7 fields.  One of the fields is a dropdown, and the others are all text inputs.  I will be adding an 8th field soon(it will be a checkbox).  

Also, I want it to be that when the fields are blank, it still filters the gallery but by a wildcard.  That wildcard will mean "anything".  My first thought was using an If statement.  

Ex: If('Input-TypeOfChange.Text' in Title, StartsWith(Title, 'Input-TypeOfChange.Text') . . .  The ellipses at the end is because I didn't finish it.  (I know this formula is all wrong, but just bear with me)

My question:  How can I create a way to filter my gallery in the easiest, and most simplest, way possible.  

Thanks guys.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @FranzCarson3 

    Keep it simple and avoid the If statements!

    Just build your filter around the conditions you want.  Don't worry about the concept of a "Wildcard" if the search is blank.

    If you have a textinput for search for, let's say the Title column, then this formula:

       Filter(yourDataSource, StartsWith(Title, txtInputSearch.Text))

    will result in all rows if the text is blank and if not, then only rows that start with the value in the search.

     

    I hope this is helpful for you and what you were meaning.

  • LRVinNC Profile Picture
    2,297 on at

    Here's a example where I have a bank of 11 possible filters in which the user can use none or all 11.  Here's a excerpt from the filter for the gallery.  (The full logic repeats portions of this set of criteria depending on some other variables - this is one complete set of criteria).

    FilterExample.jpg

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @FranzCarson3 

    Like @RandyHayes says but to make sure that your dropdown includes a blank value please see https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-Dropdown-with-blank-null-default/td-p/58172  for a discussion as to how to make a dropdown control show a blank value by default.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Drrickryp    or if you want to avoid putting blank and default "All" items in your data source, then watch this video on how to do it dynamically.

  • FranzCarson3 Profile Picture
    71 on at

    Hey,
    I tried this and it worked.  But now my question is how do I add multiple fields to it?
    And I forgot to mention that 3 of my fields are date pickers.

    Thanks

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @FranzCarson3 

    Can you describe what you tried?  You have three different responses to your post.  Mine, @Drrickryp 's or @LRVinNC 's ?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @FranzCarson3 

    Oh, and if it was mine that you were referring to, then you can utilize the following:

       Filter(yourDataSource,

               StartsWith(Title, txtInputSearch.Text) ||

               StartsWith(anotherColumn, txtInputSearch.Text) ||

              ...etc...

       )

  • FranzCarson3 Profile Picture
    71 on at

    @RandyHayes 
    I tried this out, and it doesn't seem to filter the gallery at all.
    Filter(
    'Invoice Activities - No Opportunities',
    StartsWith(
    Title,
    'Imput-TypeOfChangeFilterImput'.Text
    ) || StartsWith(
    'Customer Name',
    'Imput-CustomerNameFilterImput'.Text
    ) || 'Drop-SignedAgreementFilterDropdown'.Selected.Value = 'Signed Agreement'.Value || 'Date-DateRequestedFilterDatePicker'.SelectedDate = 'Date Requested' || 'Date-ReadyToInvoiceFilterDatePicker'.SelectedDate = 'Ready To Invoice' || 'Date-Invoice/ReturnDateFilterDatePicker'.SelectedDate = 'Invoice/Return Date' || StartsWith(
    Notes,
    'Imput-NotesFilterImput'.Text
    )
    )

    I have this.  I just want to make sure that this is what you meant.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @FranzCarson3 

    Yes, you are on the right track.  I would suspect you are having problems from the Dates.  So, change your formula to the following and see if it returns results as expected:

    Filter(
     'Invoice Activities - No Opportunities',
     StartsWith(Title, 'Imput-TypeOfChangeFilterImput'.Text) || 
     StartsWith('Customer Name', 'Imput-CustomerNameFilterImput'.Text) || 
     StartsWith(Notes,'Imput-NotesFilterImput'.Text
     )
    )

    Then we can expand from there. 

  • FranzCarson3 Profile Picture
    71 on at

    @RandyHayes,
    I have it changed, and it worked the first time I did it, but it just stopped working.  Here's what my app looks like:

    Invoice Filter Pic.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard