web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best way of Filtering ...
Power Apps
Unanswered

Best way of Filtering a Choice List

(0) ShareShare
ReportReport
Posted on by 716 Moderator
The goal is a single product list with a parameter indicating whether it's for one corp, the other corp or both corps.
 
When creating a record, users need to select which products the customer is interested in.
 
I wish to use a single control in the app to handle this but we have overlapping products. Since I can't add a parameter into the Choice column itself, my thought was to create a separate list with just two columns. The product name and a Choice column to indicate who it is for.
 
But that method leads to it's own challenges within the Comboboxes themselves since I end up with Text values in the combobox which don't correspond to the choices in the Choice column on the main record.
Which I could solve by making that just a text field since something else now controls the Items.
 
But before I go and do things, I thought I'd inquire about prior experience and the best or better way to handle this requirement if there is a better path.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    152,845 Most Valuable Professional on at
    Best way of Filtering a Choice List
    You can forget about a Choice column (which you do not need anyway) with multiple fields. Make a separate list with the options - a separate record for each "combination". Then the first Combo Box Items would be
    Distinct(ListName, FirstFieldName)
    and the second Combo Box Items
    Filter(
       ListName,
       FirstFieldName = FirstComboBox.Selected.Value,
    ).SecondFieldName
    then write back to Text fields in the main list - First Data Card Update
    FirstComboBox.Selected.Value
    Second Data Card Update
    SecondComboBox.Selected.SecondFieldName
    First Combo Box DefaultSelectedItems
    {Value: ThisItem.FirstMainListFieldName}
    Second Combo Box DefaultSelectedItems
    {SecondFieldName: ThisItem.SecondMainListFieldName}
     
    Please click 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 giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • DCHammer Profile Picture
    716 Moderator on at
    Best way of Filtering a Choice List
    Thanks Warren. I was part way there but was trying to use a choice column in the main list which as you've pointed out is completely unnecessary since the Choices are coming from somewhere else.
     
    I only have one actual combobox for Products. What is going to appear in that combobox will be based on the selection in another control.
     
    So the first combobox is actually just a radio button indicating which Corp.
     
    Then this will populate the Combobox:
    Filter(
       Products,
       Corporation = radioCorpSelect.Selected.Value,
    ).Product_Name
    I would have gotten stuck with the DefaultSelectedItems values so thanks muchly for that.
  • DCHammer Profile Picture
    716 Moderator on at
    Best way of Filtering a Choice List
    @WarrenBelz​​​​​​​ I need a little guidance about writing the values to the text column even though I marked this complete. Maybe I should make another Post so credit is rewarded.
     
    Anyway, here is what I have working:
     
    Datacard1: Radio control with just two choices "to X" or "to Y". This is working correctly both visually and with SubmitForm. Default was tricky but this solved it:
    If(
        frmLead.Mode = FormMode.Edit,
        ThisItem.Lead_Direction.Value,
        frmLead.Mode = FormMode.New,
        ""
    )
    Datacard2: This has combobox2 with the products.
    Items:
    If(
        ThisItem.Lead_Direction.Value = "to X",
        Filter(
            'Cross Sell - Products',
            Corporation.Value = "X"
        ).Product_Name,
        Filter(
            'Cross Sell - Products',
            Corporation.Value = "Y"
        ).Product_Name)
    Datafield: "Products_Interested". Field it a single line text field.
     
    My struggle is with the Default property on combobox2 as well as the Update property.
    I think I could get the contents out of the control and into a string to save in the text field but how do I then turn that string back into individual values to reference in the combobox selection.
     
    I'm fairly certain your explanation below has adequate details but I can't parse them out on my own.
     
  • Verified answer
    WarrenBelz Profile Picture
    152,845 Most Valuable Professional on at
    Best way of Filtering a Choice List
    DefaultSelectedItems should be
    {Product_Name: ThisItem.Products_Interested}
    and Update
    YourComboBoxName.Selected.Product_Name
     
    Please click 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 giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard