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 out selected...
Power Apps
Unanswered

Filtering out selected items from items control in combo box

(0) ShareShare
ReportReport
Posted on by 3,347

Not sure if there is a better way, but it is possible that the items may show an identical item shown in the selected items control in a combo box.  How can I filter them out??

 

This shows circular reference, which makes sense.  This is the items control of cmb_SNSelect combo box.:

 

 

Filter(WOFilter,!CountIf(cmb_SNSelect.SelectedItems,Value=ThisRecord.Value))

 

 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @martinav,

     

    I would've also solved it in that manner. Is the issue that the Filter() does not work? This might be because Power Apps does not know what 'ThisRecord' actually refers to, since we have nested functions that loop through the datasource (countif & filter).

    A way to solve this is by explicitly telling what record we are refering to via 'As NameForThisRecord':

    Filter(
     WOFilter As Main,
     !CountIf(
     cmb_SNSelect.SelectedItems,
     Value = Main.Value
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • martinav Profile Picture
    3,347 on at

    Yes, that is smart to be explicit, but yet, it didn't resolve the circular reference problem.  I may have to trigger an external context to generate items somewhere else using OnChange.  I was hoping not too.  It just dirties up the application.

  • LaurensM Profile Picture
    12,516 Moderator on at

    My Apologies @martinav, I was wrongfully under the impressions that we wanted to filter based on another combobox selection. I should've read more carefully 🙂

     

    Indeed, referencing the SelectedItems of the same control leads to a circular reference. This problem persists when adding the With() function and locally store the selection as a workaround.

     

    In my previous solutions, I collected the selection during the OnChange and filtered based on the collection items (alternatively use a variable). However, as you said - it leads to yet another external context.

  • martinav Profile Picture
    3,347 on at

    @LaurensM ,

     

    Yea, its all good.  No harm done.  Its very difficult to keep applications orderly as you know.  I have been making some very complex applications, and I'm worried that if/when I get hit by a bus if anyone will be able to decipher them to keep them going.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard