cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
svenvu
Level: Powered On

Why is there no AllowUnsetValue property for combobox to set a default blank value?

Hi

 

The AllowUnsetValue property of a regular dropdown is absolutely awesome. I found this secret property hidden on this forum and it can be used to set the default selected item in a drop down menu as a blank value when set to "true". Finally an easy solution that actually works! Thank you PowerApps-team!

dropdown blank value.PNG

 

Unfortunately there is no AllowUnsetValue property for a combobox (with single select in my usecase). Why is that? These are similar controls. Or does this have a different name for comboboxes?

 

I'm just looking for a way to display a blank value in a combobox when a new record has to be created in a gallery EditScreen while maintaining the default selected item when editting an existing record. But it seems like it's only one way or the other way and both can't go together, unless I would have something like the AllowUnSetValue 😮

 

My Items property for the single select combobox is:

'Office365-users'.SearchUser({searchTerm: ComboBox1.SearchText}).DisplayName

This gives me a beautiful list of all the employee names from the Office365-connector and the default value is blank which is what I want:

Combobox.PNG

 

My DefaultSelectedItems property for the combobox is: 

'Office365-Users'.SearchUser({searchTerm: Parent.Default}).DisplayName

This is necessary. Without this, the combobox is reset to blank when editting an existing record. The combobox however needs to be the selected item from the ViewForm. Now the behaviour for editting an item becomes correct but the behaviour for creating a new item becomes wrong. When creating a new record, the first employeename in the Office365-list becomes the default where I want this to be blank...

Combobox1.PNG

 

My Default property for the combobox is nothing at all

 

 

My Default property for the Gallery card is:

ThisItem.Emloyee

This is where the data is saved in a CDS table, lets say Table1, column Employee

 

My Update property for the Gallery card is:

ComboBox1.Selected.DisplayName

 

Question:

If the awesome AllowUnsetValue property doesn't exist for comboboxes, is there any workaround as the behaviour of my form is almost perfect, but actually not because when creating a new record, the first name of the Office365-list of employees is automatically selected Smiley Sad

 

Friendly greets

1 ACCEPTED SOLUTION

Accepted Solutions
svenvu
Level: Powered On

Re: Why is there no AllowUnsetValue property for combobox to set a default blank value?

I found the solution thanks to Carlos:

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()). So the formula needs to be:

If(EditForm1.Mode=FormMode.Edit;'Office365-users'.SearchUser({searchTerm:Parent.Default}).DisplayName;Blank())

 

Hopefully this is useful for other people searching for this 🙂

View solution in original post

1 REPLY 1
svenvu
Level: Powered On

Re: Why is there no AllowUnsetValue property for combobox to set a default blank value?

I found the solution thanks to Carlos:

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()). So the formula needs to be:

If(EditForm1.Mode=FormMode.Edit;'Office365-users'.SearchUser({searchTerm:Parent.Default}).DisplayName;Blank())

 

Hopefully this is useful for other people searching for this 🙂

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,402)