How to clear SharePoint columns within your Power Apps
When using the SharePoint default form, you can easily clear values from each type of field by just editing the item, clearing the field value and saving the form. Unfortunately that doesn’t work that easy out of the box when using a Power Apps form.
In this blogpost, I will explain to you how you can achieve this in Power Apps as well.
SharePoint form
As said, when using the default SharePoint form to clear a field value, you just edit the item, clear out the values and save the form. Easy as that:
Power Apps form
Unfortunately, it is not this straightforward when using Power Apps. In the example below, I’ve created a simple Power App that has an editform, a save button and a viewform:
The save button has a simple SubmitForm() action that will push all changes to the SharePoint list. Or doesn’t it? When you clear all values from the editform (except for Title, because that’s a required field) and click Save form, only the multiline and Hyperlink field are cleared:
Blank vs. Null
So, how is this possible? After some digging on the web, I found this article which states that a Blank value cannot always be differentiated from a null value, resulting in unexpected behavior of your data storage. Although this article refers to SQL Server, I thought this was interesting for the scenario above. So I started playing around with this experimental feature ‘Formula-level Error Management‘ that was referred to in this article.
Formula-level Error Management
Formula Level Error Management is an experimental feature that’s been around for more than two years now. You can enable it from within your Power App by going to File > Settings> Advanced settings > Experimental features > Formula-level Error Management.
After turning this feature on, nothing really changes. Not on the visual aspect of things. But what happens now when you clear all fields inside your form and save it? That’s right, the corresponding item fields in SharePoint will get cleared as well:
Final thoughts
If you are looking for a way to clear ‘special’ column types in SharePoint (such as Choice, People, Date or Lookup columns) using a Power Apps form, you should be aware that this isn’t possible out of the box.
You should use another option such as the experimental feature called ‘Formula-level Error Management’. There are also some other options for specific column types by using the Patch function or changing the Update parameter of your DataCard, but I won’t be covering this here.
However this feature is available for more than two years now, it is still an experimental feature. This means this feature could be altered or deprecated by Microsoft, resulting in unexpected behavior of your Power App. So please be aware of this when enabling this feature for your Production app(s).
One Reply to “How to clear SharePoint columns within your Power Apps”
Very interesting Rik!