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 SQL from Com...
Power Apps
Answered

Filtering SQL from Combobox

(0) ShareShare
ReportReport
Posted on by 119

I'm trying to filter a dropdown from a combobox.selected items.  Data source is SQL for both.  I believe you can't filter directly, so I have an OnChange event for combobox to concat the list of selected items together and then filter dropdown from that selected list.  Like this pseudocode:

ComboBox OnChange():

UpdateContext({varBranchCodes:Concat(cboBranches.SelectedItems,branchcode,", ")})

 

Then, for dropdown Items():

Filter(Active_Patients, varBranchCodes in CltBranch)

 

This works fine if there are 1 BranchCode selected, but as soon as I choose 2 or more, the "in" statement doesn't return any records.  I can go to the SQL source and select using those BranchCodes and return data no problem.  What am I doing wrong?

Categories:
I have the same question (0)
  • subsguts Profile Picture
    1,259 Moderator on at

    did you read this post:  Solved: Issue with "in" operator inside "Filter()" functio... - Power Platform Community (microsoft.com)

     

    Sounds like it may be the answer to your question too?

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Tommy-Upton,

    Modify the formula as below:

    Filter(Active_Patients, varBranchCodes in Concat(CltBranch,CltBranch,","))
    

    This formula will filter items that includes all the value selected in the combo box.

    (the combo box select a,b; you will only get records with value like this: a,b,c ; ab,d)

    ForAll(cboBranches.SelectedItems,Filter(Active_Patients,branchcode in CltBranch))

    If you want to filter items that only includes parts of value selected in the combo box, you could try this:

    (the combo box select a,b; you will  get records with value like this: a,c ;b,c ;a,b,c)

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
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard