Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filtering A Gallery By A Wildcard

Like (0) ShareShare
ReportReport
Posted on 2 Dec 2020 21:01:12 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:
  • dbartel Profile Picture
    2 on 30 Mar 2023 at 16:42:18
    Re: Filtering A Gallery By A Wildcard

    Somewhat unrelated question:

    When I tried to implement this method(very cool and compact), I did not use the StartsWith( ) function for the combobox value.  The filter would return zero results,  If I add StartsWith, it works fine.  Both the combobox and gallery are using the same datasource so exact matching should work.  Why does and exact match not work in the filter statement?

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 06 Dec 2020 at 23:00:27
    Re: Filtering A Gallery By A Wildcard

    @FranzCarson3 

    Okay, not so much of a problem except...how are you choosing this from your filter?  Are you considering a dropdown with static values and then base the filter conditions off of what is selected?  What is your UI for this?

  • FranzCarson3 Profile Picture
    71 on 04 Dec 2020 at 19:11:02
    Re: Filtering A Gallery By A Wildcard

    @RandyHayes 

    Hey again.  

    I have the app working as intended, but that was just stage 1.  Right now we have it to where you filter an item by a specific date, but we now want to filter the dates a different way.  We want to be able to filter by if "Ready  To Invoice" is populated, and "Invoice/Return Date" is not. Same goes for the other date field.  

    Ex. "Date Requested" is populated and "Invoice/Return Date" is not, ext...

    Based on previous knowledge, I feel like we will need to use IsBlank() and !IsBlank.

    Thanks.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 03 Dec 2020 at 19:45:03
    Re: Filtering A Gallery By A Wildcard

    @FranzCarson3 

    Very good.  Feel free to post back if you run into problems.

     

    I'm glad we finally got you to a solution! It's always nice to have details on how to do these things.
    If this resolved your problem, please go back and find which message solved the problem and mark it as a solution so that other having the same issue can find a solution quickly.

  • FranzCarson3 Profile Picture
    71 on 03 Dec 2020 at 19:40:06
    Re: Filtering A Gallery By A Wildcard

    @RandyHayes 

    I should be able to.  I just need to update my SharePoint list and then I'll add it.  Thanks for all of your help!

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 03 Dec 2020 at 19:37:52
    Re: Filtering A Gallery By A Wildcard

    @FranzCarson3 

    So you see the pattern now...are you able to add this successfully? 

  • FranzCarson3 Profile Picture
    71 on 03 Dec 2020 at 19:35:28
    Re: Filtering A Gallery By A Wildcard

    @RandyHayes 

    So that worked.  Now I just need to add the "Yes/No" column to my formula.

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 03 Dec 2020 at 19:30:32
    Re: Filtering A Gallery By A Wildcard

    @FranzCarson3 

     

    Okay...replace the names of the dropdown and the column name in the last condition of this formula:

    Filter(
     'Invoice Activities - No Opportunities',
     (IsBlank('Imput-TypeOfChangeFilterImput'.Text) || StartsWith(Title, 'Imput-TypeOfChangeFilterImput'.Text)) && 
     (IsBlank('Imput-CustomerNameFilterImput'.Text) || StartsWith('Customer Name', 'Imput-CustomerNameFilterImput'.Text)) &&
     (IsBlank('Imput-NotesFilterImput'.Text) || StartsWith(Notes, 'Imput-NotesFilterImput'.Text)) &&
     (IsBlank('Date-DateRequestedFilterDatePicker'.SelectedDate) || 'Date Requested' = 'Date-DateRequestedFilterDatePicker'.SelectedDate) &&
     (IsBlank('Date-ReadyToInvoiceFilterDatePicker'.SelectedDate) || 'Ready To Invoice' = 'Date-ReadyToInvoiceFilterDatePicker'.SelectedDate) &&
     (IsBlank(Date-Invoice/ReturnDateFilterDatePicker'.SelectedDate) || 'Invoice/Return Date' = Date-Invoice/ReturnDateFilterDatePicker'.SelectedDate) &&
     (IsBlank(SignedAgreementDropDown.Selected.Value) || SignedAgreementColumn.Value = SignedAgreementDropDown.Selected.Value)
    )

     

  • FranzCarson3 Profile Picture
    71 on 03 Dec 2020 at 19:26:16
    Re: Filtering A Gallery By A Wildcard

    @RandyHayes 

    It is defined as a "Choice" column.  I am adding a "Yes/No" column as well for if it is completed or not.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 03 Dec 2020 at 19:23:42
    Re: Filtering A Gallery By A Wildcard

    @FranzCarson3 

    Good deal...what kind of column is that defined as in your datasource?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 27

#2
mmbr1606 Profile Picture

mmbr1606 14 Super User 2025 Season 1

#3
EE-04041031-0 Profile Picture

EE-04041031-0 11

Overall leaderboard