cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AccessPowerApps
Level: Power Up

Need Dropdown with blank / null default

How do you handle the default of a drop down when you want it to always be blank when opening? I have played with the default value and it always loads the first item no matter what I do.  The Items are coming up from an on-premise SQL database. Example: I have 4 drop downs for staff members that maybe on a truck, only the first one will be required and I want the app user to start with all blanks and fill in as needed

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Need Dropdown with blank / null default

If you want to start with a blank item in the dropdown, you can set its Items property to a collection where the first element is blank. For example, if you get the possible choices from a table 'Employees' and you display the Name property in the dropdown, you can have this expression in the screen's OnVisible property:

ClearCollect(employeesWithBlank,{Name:""}); Collect(employeesWithBlank,Employees)

Then you can set the collection 'employeesWithBlank' as the Items property of your dropdown control.

 

Notice that the dropdown currently has a bug in which blank entries appear with a smaller height (can be hard to select on small screens, such as phones). You can work around this by defining the name as a 'non-breaking space':

ClearCollect(employeesWithBlank,{Name:Char(160)}); Collect(employeesWithBlank,Employees)

In this case you'll have the first option in the dropdown showing the same format as the others.

View solution in original post

14 REPLIES 14
mveroukis
Level: Powered On

Re: Need Dropdown with blank / null default

Is there a blank entry in the collection used for the dropdown? If not, try adding one.

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Need Dropdown with blank / null default

If you want to start with a blank item in the dropdown, you can set its Items property to a collection where the first element is blank. For example, if you get the possible choices from a table 'Employees' and you display the Name property in the dropdown, you can have this expression in the screen's OnVisible property:

ClearCollect(employeesWithBlank,{Name:""}); Collect(employeesWithBlank,Employees)

Then you can set the collection 'employeesWithBlank' as the Items property of your dropdown control.

 

Notice that the dropdown currently has a bug in which blank entries appear with a smaller height (can be hard to select on small screens, such as phones). You can work around this by defining the name as a 'non-breaking space':

ClearCollect(employeesWithBlank,{Name:Char(160)}); Collect(employeesWithBlank,Employees)

In this case you'll have the first option in the dropdown showing the same format as the others.

View solution in original post

Power Apps Staff miglisic
Power Apps Staff

Re: Need Dropdown with blank / null default

FYI: The smaller height bug will be fixed in the 710 release.

 

Shamrock
Level: Powered On

Re: Need Dropdown with blank / null default

Hi, I am new to PowerApps and have
a similar problem with a dropdown field. My Items property of the dropdown are coming from an on-premises SQL databas table as well. I’ve tried using the suggested collection, but it only works for the new form when adding a new record. When editing an existiing record, the dropdown is blank but it should have been a pre-selected value.It used to work properly without using the collection. Any suggestions? Thank you!
Super User
Super User

Re: Need Dropdown with blank / null default

@Shamrock Share a screenshot of the value for items and default for the dropdown and I bet we can figure it out. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Shamrock
Level: Powered On

Re: Need Dropdown with blank / null default

Hi @Shanescows, Thank you so much for getting back to me. I've resolved it by filtering the Editform. mode. 🙂

svenvu
Level: Powered On

Re: Need Dropdown with blank / null default

How did you manage to do the last step? Can you provide more details? I know this is an old post, if someone else can help, please advise as I'm stuck.

  • The dropdown is blank when a new item is created in the EditScreen of the form ==> this is correct
  • But when I change an existing item from the DetailScreen of the form, the dropdown is also blank while I'm expecting a preselected item that is passed from the DetailScreen
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Need Dropdown with blank / null default

The dropdown control now has a new property that allows it to have empty defaults. Check for the AllowUnsetValue property in the control, and if you set it to true, you should be able to set the Default property to a blank value, and you'll start the dropdown without a selection.

svenvu
Level: Powered On

Re: Need Dropdown with blank / null default

Thank you Carlos! I discovered this new property yesterday and started a new topic that is waiting for approval because it's marked as spam. This is the best property ever! But unfortunately not available for comboboxes 😞 

Now my gallery form is almost perfect but I can't change the combobox (with single select and search) to a dropdown because it contains a list of thousands of employee names (from the Office365-connector). Is there any chance this property could be made available for comboboxes?

 

I think this is also great for a blog post as this property deserves to be in the spotlight because a lot of people are searching for a solution and this property makes it so easy . Often a dropdown/combobox has to be empty so the user must select something.

 

Friendly Greets

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,839)