cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AccessPowerApps
New Member

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

19 REPLIES 19


@svenvu wrote:

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?

 


The combobox has, since it was introduced, supported empty selection, so there's no need to set any property for that.

Hi Carlos

 

Thank you for looking into this!

I have documented the specific usecase in this topic that is now removed from the spamfolder:

https://powerusers.microsoft.com/t5/General-Discussion/Why-is-there-no-AllowUnsetValue-property-for-...

 

And I found the solution in your blogpost:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

In the DefaultSelectedItems property from the combobox I had to enrich the formula with: If(EditForm1.Mode=FormMode.Edit;....;Blank()). I would not have guessed that myself. You're always welcome to screen the topic and give advise for best practices 🙂

 

Big thanks!

There's a problem with this feature, once you select a value, you cannot select the blank value again.  It's removed from the list.

The old Advanced Property in DropDown DataCardValues named "AllowUnsetValue" has been renamed to "AllowEmptySelection"

On Dropdown-DataCardValues you can set this "AllowEmptySelection" property to value "true" and the Default-Property to "" then you will have a blank default value in the Dropdowns. For all FormModes, of course

It makes sense to set this Default-Blank only to FormMode.New otherwise each edit will update with blanks:

 

If(SharePointForm1.Mode=FormMode.New, "", Parent.Default)

 

Not available for Combo Boxes

I am struggling with this as well.  I am using a dropdown control, and if I *change* either the Default or Reset, then I am presented with a drop down with nothing selected.  But once I select something, and stop and restart the App, the previous selection persists.  I think I need to start with the empty control, because I'm loading a gallery once the dropdown item is selected.  I don't want to load the gallery with the previously selected item.

Hi all

 

Just a quick sidenote. The property is called AllowEmptySelection and not AllowUnsetSelection.

 

But after posting this I saw that someone already mentioned this. Dope 😉

 

Dawid van Heerden

Follow on Twitter: @DavesTechTips

Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

 

**If you found this reply helpful, please give it a thumbs up and Accept as Solution to close the topic and make it easier to find for other people with similar questions.

Anonymous
Not applicable

Dear Carlos,

your example works fine in case the table Employees has ONLY a Name column. 

A generally correct formula would be:

 

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

 It took me some time to figure that one out 😃

 

Ciao,

reinvdo

Anonymous
Not applicable

Dear Carlos,

the solution you propose has a strange side-effect in my app: the drop-down box will NOT select the default value automatically maybe because employeesWithBlank is a collection and not a Table. When I use the Table the drop-down selects the Parent.Default value correctly. In case of the collection it selects the 'empty' value. 

Any hints to correct this?

Thanx fro your support.

Ciao,

reinvdo

AJ_vizMan
Helper I
Helper I

 

Hipromark
Frequent Visitor

Hello,

 

I was looking for a similar solution and found out this is pretty simple to solve.

 

Just put Zero in Properties > default and put True in 'Allow empty selection' , your drop down will show an empty value as default.

null-value-drop-down.JPG

 

I hope this works for you also.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,940)