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!
Solved! Go to Solution.
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.
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?
@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.
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.
@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
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)
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
49 |