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 / Default Blank Combobox...
Power Apps
Unanswered

Default Blank Combobox to all

(0) ShareShare
ReportReport
Posted on by 29

Hi,

Does anybody know how I can get a Combo Box to default to all if nothing is selected?

At the moment, I have had to set the DefaultSelectedItems to be all values, as if I leave it blank, the search fails.

This means that if there are particular values that people don't want to search for, they have to deselect them.

I would rather, if possible, have people select the values they want to filter by, and be able to leave it blank if they want to search for everything.

Would greatly appreciate any help. 🙂

Many thanks

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Motty_25 

    You can account for this in your formula by looking to see how many items are selected - if none, then assume all, if some, then filter on just those items.

    CountRows(yourCombobox.SelectedItems) will return 0 if nothing is selected and you can use that to base your logic on.

     

    I hope this is helpful for you.

  • Motty_25 Profile Picture
    29 on at

    Hi @RandyHayes 

    Thanks for your response.

    Where exactly would this command go? Would this be part of my formula for the filter gallery? (the one which loads when people select the options from the combo boxes and click search) Or would it be part of the properties for each ComboBox?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Motty_25 

    Yes it would be part of the Items property.  What is your formula for that? 

  • Motty_25 Profile Picture
    29 on at

    @RandyHayes 
    The formula for each ComboBox is currently
    Choices(ListName.FieldName)

     

    The formula for my filter gallery is:
    Filter(ListName, FieldName1 in ComboBox2.SelectedItems, FieldName2 in ComboBox2_2.SelectedItems, FieldName3 in ComboBox2_1.SelectedItems, FieldName4 in ComboBox2_3.SelectedItems)

    (yes, I know I should have named my ComboBoxes properly instead of just keeping the default name after copying them!)

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Motty_25 

    If you have all four comboboxes that you want to apply this logic to, then your formula will be:

    Filter(ListName, 
     (CountRows(ComboBox2.SelectedItems)= 0 || FieldName1 in ComboBox2.SelectedItems) &&
     (CountRows(ComboBox2_2.SelectedItems) = 0 || FieldName2 in ComboBox2_2.SelectedItems) &&
     (CountRows(ComboBox2_1.SelectedItems) = 0 || FieldName3 in ComboBox2_1.SelectedItems) &&
     (CountRows(ComboBox2_3.SelectedItems) = 0 || FieldName4 in ComboBox2_3.SelectedItems)
    )
  • Motty_25 Profile Picture
    29 on at

    @RandyHayes 

    Thank you, that's worked! Although I now have another issue.

    I've currently got the DefaultSelectedItems for each of these ComboBoxes to be all options for that particular field.
    If I clear this setting so nothing is selected by default, then when I select the values I want, the search fails.

  • Motty_25 Profile Picture
    29 on at

    Hi all,

    Sorry to bump this, but was just wondering if anybody could advise on this?

    The issue I now have, is that if I manually deselect the options on the ComboBox, the search works fine, but if I change the DefaultSelectedItems to none, the search fails.

    Does anybody know why this might be?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Motty_25 

    Sorry to lose track of your post.  Just seeing it now.

     

    So tell me more about this scenario.  What are the Items properties and the DefaultSelectedItems property formulas?

  • Motty_25 Profile Picture
    29 on at

    @RandyHayes 

    So, my list name is Register and I have four fields called Asset Type, Status, Location and Model, each of which has a ComboBox associated.

    For each ComboBox, both the Items and DefaultSelectedItems properties are "Choices(Register.FieldName)" - e.g. "Choices(Register. 'Asset Type), "Choices(Register.Status)" and so on.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Motty_25 

    Okay, so all of the comboboxes have a table with a single column record called Value with those formulas - and you are specifying all of the choices in your DefaultSelectedItems (DSI) property.

     

    Where is the problem coming from?  You state that you set the DSI to none - what does that mean??

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard