cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexleetoo17
Helper I
Helper I

'Allow Empty Selection' missing from DataCard DropDown

I'm customizing a SharePoint List Form and trying to reset the a dropdown control to blank when the user clicks a button. 

Button

OnSelect: UpdateContext({clearErrorVar: true })&Reset(errorDropDown)

errorDropDown

DefaultSelectedItems: If(clearErrorVar=false, Parent.Default)

EditScreen

OnVisible: UpdateContext({clearErrorVar:false})

 

In theory, clearErrorVar is always false UNLESS the user clicks the button, so the errorDropDown should be Parent.Default until the user clicks the button and resets the field (which is blank on reset because clearErrorVar is true). This all seems to work within the form, but when I save it, it doesn't update the field appropriately--in the SharePoint list, the column still shows the original selected value instead of being empty.

 

The out of the box dropdown control generated from the SharePoint column doesn't have the 'Allow Empty Selection' attribute, presumably why it won't update the field as empty. Adding a custom dropdown control from within PowerApps does have the 'Empty Selection' attribute, but does not have the 'Default Selected Items' attribute, which I also need to keep the info in the field until it gets reset. 

 

Anybody know a workaround so I can reset this control with a button, but otherwise have it inherit Parent.Default? Or am I missing something obvious? Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@alexleetoo17 

Well, SharePoint is not the one generating Comboboxes, it would be how PowerApps interprets your column when it generates the form.

What is the column type and is it set to allow multiple values?

 

Dropdowns and Comboboxes are drastically different.  A combobox is used when you need multiple selections or searching.  Dropdowns do not provide those capabilities. 

So the choice is going to have to be based on the column data type.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@alexleetoo17 

You appear to be mixing control types!

Comboboxes have DefaultSelectedItems properties and not AllowEmptySelection properties.  Dropdowns have AllowEmptySelection properties and do NOT have DefaultSelectedItems properties.

 

So which is it that you really are looking for to use?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes Well I thought I was using dropdowns this whole time but it sounds like SharePoint generates comboboxes by default? I don't have a preference between the two, I just need a field that can inherit its properties until the user intentionally resets them.

 

RandyHayes
Super User
Super User

@alexleetoo17 

Well, SharePoint is not the one generating Comboboxes, it would be how PowerApps interprets your column when it generates the form.

What is the column type and is it set to allow multiple values?

 

Dropdowns and Comboboxes are drastically different.  A combobox is used when you need multiple selections or searching.  Dropdowns do not provide those capabilities. 

So the choice is going to have to be based on the column data type.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes  Column type is 'Choice' in SharePoint and it does allow multi-select so PowerApps must be reading that as ComboBox. Thanks for clarifying! I guess I need to rethink this

 

RandyHayes
Super User
Super User

@alexleetoo17 

It's all good.  If it is a combobox and you want it to reset to blank selections, then you just need to set the DefaultSelectedItems property to blank.

The formula you stated in your original post would not be doing that properly.

It should be:  If(clearErrorVar, Blank(), Parent.Default)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,763)