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 Second Combo Bo...
Power Apps
Answered

Filter Second Combo Box with Selection in First Combo Box

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have 2 tables (lots_table and sublots_table) that are related through a primary and foreign key respectively. Both combo boxes are set to single selection. The 1st combo box's (cmbLots) Items property is "lots_table". The DisplayFields property of the 1st combo box (cmbLots) is a text field in the lots_table.

 

The 2nd combo box's Items property is:

Filter(sublots_table, lots_table_fk.Id = cmbLots.Selected.ID)

 

The 2nd combo box's (cmbSublots) DisplayFields property is a text field in the sublots_table.

 

Currently there are no errors in the code and combo box 2 (cmbSublots) does display the text field referenced. However, combo box 2 (cmbSublots) does not filter based on the selection in combo box 1 (cmbLots). I need this filter to work.

 

Please help! Thanks

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    If you used a dropdown control and set its items property to 

    Filter(sublots_table, lots_table_fk.Id = cmbLots.Selected.ID)

    would it work? I did find a reference to filtering comboboxes but haven't tried it.  https://powerusers.microsoft.com/t5/Building-Power-Apps/Filtering-one-combo-box-items-based-on-another-combo-box/td-p/189934 

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    If my understanding is correct, the data source is SQL Server and the lots_table_fk is the column in sublots_table that is the foreign key of lots_table, right?

    So please try this code:

    Filter(sublots_table, lots_table_fk = cmbLots.Selected.ID)

     Hope this helps.

    Sik

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I figured it out. Little embarrassing. Code below.

     

    Filter(sublots_table, lots_table_fk = cmbLots.Selected.lots_table_pk)

     

    Could have swore I tried this initially. Guess not. Thanks for the help you guys.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard