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 / combo box filter based...
Power Apps
Answered

combo box filter based on previous multi choice combo box

(0) ShareShare
ReportReport
Posted on by 124

Hello!

 

I have been going through the forums here, trying to find a solution to my issue and I am not sure I can find one.  If there is indeed a previously posted solution, can someone please point me to it??

 

If not, my issue -

 

I have a form that I am working on that has many combo boxes and most of them are multi-choice.  Furthermore, quite often, what is chosen on that multi-choice combo box will determine what is in the next dropdown box.

 

First multi-choice box - 

davyjones_0-1623179080602.png

And this is the syntax for that box - 

davyjones_1-1623179141711.png

The next combo box is currently (correctly) set up to choose ONE country group from the previous list of region

davyjones_2-1623179252082.png

the current syntax for that single choice - 

davyjones_3-1623179327339.png

 

Not sure if you need to know what every group of choices is a different sharepoint list

So again my question - I want the end users to be able to select MULTIPLE regions, and then have all applicable countries available for them.  Currently, if I choose multiple regions, the syntax only chooses the countries from the last of the region choices.


Please help me!


Thank you

Categories:
  • Verified answer
    DylanSimons Profile Picture
    326 on at

    I don't think there is a very easy way to do this. What I would do is use collections like this:

    • when a user makes a selection in the first combo box, it will create a collection
    • this collection will be used as the list for the next dropbox.

    It will look something like this. Put it in your OnChange property of the first combobox;

     

    ClearCollect(DropboxCol, Blank()); //clear the collection, otherwise it will keep adding to the same collection.
    ForAll(Self.SelectedItems,
    Collect(DropboxCol,Sort (Distinct ( Filter ( 'CV&S Intake_Region_Country', StartsWith( Region, Result)), Country), Result))
    )

     

    please note that when using ForAll(), you don't need to call the item again so there is nothing in front of the "Result", which would have been "cmbRegion.Selected.Result".

     

    then use the collection as the datasource for the second dropbox.

     

    Please keep in mind that this is not delegable, so if you have over 500 items, it will simply get the first 500(or 2,000 if the setting is changed).

  • davyjones Profile Picture
    124 on at

    Okay, so far so good I think.  I havent yet worked with 'collections' so I am guessing that this doesnt write to a Sharepoint list like others, rather temporarily put a list together so that the next dropdown can choose.  How do I then change the syntax of the 'country' combo box to complete these choices?


    Thank you again!

  • Verified answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @davyjones ,

    The below uses the With() statement only for Delegation reasons and assumes that the data you want is in the newest 2,000 (if you have your limit set to this) records in your List. The Items of the second drop-down

    With(
     {
     wList: 
     Sort(
     'CV&S Intake_Region_Country',
     ID,
     Descending
     )
     },
     Sort(
     Distinct(
     Filter(
     wList,
     Region in YourComboBox1.SelectedItems
     ),
     Country
     ),
     Result
     )
    )

     

    Please click Accept as solution 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 giving it Thumbs Up.

  • davyjones Profile Picture
    124 on at

    Hello again!  Well, I tried both solutions together and there seems to be an issue with the second part.  To revisit where I have put each part:

     

    davyjones_0-1623416145990.png

     

    I also have my original syntax in the 'Items' part:

     

    davyjones_1-1623416224096.png

     

    Then, for the second dropdown, I have the newest addition (note that I changed the part that said 'yourcombobox' because I assumed that it meant to put mine in there.  I did originally try it exactly as written, though)

     

    davyjones_2-1623416431529.png

     

    I also got a new warning when I tried the new syntax in this area:

     

    davyjones_3-1623416525233.png

     

    So now I am VERY lost.  I am very happy for the help so far, but this is surely outside of my expertise.  Where am I going wrong now?

     

    Thank you all for reading and helping!


    David

     

     

     

  • DylanSimons Profile Picture
    326 on at

    Hey david, sorry I didn't see this reply. Did you get it figured out? Do you still have issues with the App?

  • davyjones Profile Picture
    124 on at

    Using both did indeed work!  I replied last week when I had a stupid typo in the syntax and couldnt figure why the boxes werent working.  Checked today and removed the typo.  Yay and thank you!

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard