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 / ComboBox Filter with c...
Power Apps
Answered

ComboBox Filter with collection

(1) ShareShare
ReportReport
Posted on by 26
Hello!
 
I have a collection MainMatCol that collects all items on my sharepoint list in the main screen as soon as I start the app. 
On my main screen, i have a button to navigate to the HistoryScreen where I have a gallery that displays all of the items on the list if my filters are blank, and it filters if they aren't.
 
It was working before I added the option to show multiple selection on my combobox, called FilterReqNumber

See below:

BEFORE:
On the Items for my gallery, 
 
 
    If(
        IsBlank(FilterBatch.Text)
            && IsBlank(ddFilterStatus.Selected.Value)
            && IsBlank(FilterReqNumber.Selected.RequestNumber)
            && IsBlank(BOLfilter.Selected.Value),
 
        MainMatCol,
 
        Filter(
            MainMatCol,
            IsBlank(FilterBatch.Text) || Batch = FilterBatch.Text,
            IsBlank(ddFilterStatus.Selected.Value) || Status = ddFilterStatus.Selected.Value,
            IsBlank(FilterReqNumber.Selected) || RequestNumber  = FilterReqNumber.Selected.RequestNumber,
            IsBlank(BOLfilter.Selected.Value) || PickReference = BOLfilter.Selected.Value
        )
    )

 
the issue here was that, for FilterReqNumber it would only filter the last selection and not all of the selection on my combobox.
So i wanted to be able to select multiple to filter out the gallery, doing what's below:
 
 
AFTER
 
 
    If(
        IsBlank(FilterBatch.Text)
            && IsBlank(ddFilterStatus.Selected.Value)
            && IsEmpty(FilterReqNumber.SelectedItems.RequestNumber)
            && IsBlank(BOLfilter.Selected.Value),
 
        MainMatCol,
 
        Filter(
            MainMatCol,
            IsBlank(FilterBatch.Text) || Batch = FilterBatch.Text,
            IsBlank(ddFilterStatus.Selected.Value) || Status = ddFilterStatus.Selected.Value,
            IsEmpty(FilterReqNumber.SelectedItems) || RequestNumber in ShowColumns(FilterReqNumber.SelectedItems, 'RequestNumber'),
            IsBlank(BOLfilter.Selected.Value) || PickReference = BOLfilter.Selected.Value
        )
    )
 
So after changing to be able to filter multiple selection, now when I navigate to this screen it starts with the gallery empty. It only works when I filter the FilterReqNumber, or when I unfilter it and then the gallery reapears with all items.
Anyone have an idea of what could be the error here?
 
 
Categories:
I have the same question (0)
  • Verified answer
    MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
     
    Try this Power Fx.
    With(
        {
            _batch: Trim(FilterBatch.Text),
            _status: ddFilterStatus.Selected.Value,
            _bol: BOLfilter.Selected.Value,
    
            // Extract selected RequestNumbers as a single-column table named "Value"
            _reqs: RenameColumns(
                ShowColumns(FilterReqNumber.SelectedItems, "RequestNumber"),
                "RequestNumber",
                "Value"
            ),
    
            // True when no meaningful RequestNumber is selected
            _noReqFilter: CountRows(
                Filter(
                    FilterReqNumber.SelectedItems,
                    !IsBlank(RequestNumber)
                )
            ) = 0
        },
    
        Filter(
            MainMatCol,
            IsBlank(_batch) || Batch = _batch,
            IsBlank(_status) || Status = _status,
            _noReqFilter || RequestNumber in _reqs.Value,
            IsBlank(_bol) || PickReference = _bol
        )
    )
    
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • Verified answer
    deepakmehta13a Profile Picture
    369 on at

    Hello

    The reason your gallery was likely appearing empty on start is that  IsEmpty() or the In operator can behave inconsistently when a ComboBox is in its initial "unselected" state upon screen navigation.

    To fix this, it is recommended to use  CountRows(). This is a more explicit way to tell Power Apps: "If the number of selected items is zero, ignore this filter."

    Try updating your Gallery's Items property to the following:

     

    If(
        IsBlank(FilterBatch.Text) && 
        IsBlank(ddFilterStatus.Selected.Value) && 
        CountRows(FilterReqNumber.SelectedItems) = 0 && 
        IsBlank(BOLfilter.Selected.Value),


        MainMatCol,


        Filter(
            MainMatCol,
            IsBlank(FilterBatch.Text) || Batch = FilterBatch.Text,
            IsBlank(ddFilterStatus.Selected.Value) || Status = ddFilterStatus.Selected.Value,
         
            // Filter by Multiple Request Numbers (ComboBox)
            CountRows(FilterReqNumber.SelectedItems) = 0 || RequestNumber in FilterReqNumber.SelectedItems.RequestNumber,
           
            IsBlank(BOLfilter.Selected.Value) || PickReference = BOLfilter.Selected.Value
        )
    )


     

    ✅ If this helped, please Accept as Solution to help others ❤️. A Like is appreciated.

     

  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I will add another option as you have a Delegation issue in there and also offer some suggestions on detecting blank/empty fields (Blank does not detect empty strings ""). You did not say what type of field RequestNumber was. Assuming it is a Single Line of Text
    With(
       {
          _Data:
          Filter(
             MainMatCol,
             Len(FilterBatch.Text) = 0 || Batch = FilterBatch.Text,
             Len(ddFilterStatus.Selected.Value) = 0 || Status = ddFilterStatus.Selected.Value,
             Len(BOLfilter.Selected.Value) = 0 || PickReference = BOLfilter.Selected.Value
          )
       }
       Filter(
          _Data,
          IsEmpty(FilterReqNumber.SelectedItems) ||
          RequestNumber in FilterReqNumber.SelectedItems.'RequestNumber'
       )
    )
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
     
  • MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
     
    A quick follow-up to see, does the suggestion from myself or @WarrenBelz does worked for you or still you were looking for any other approaches or assistance.
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard