Yesterday on LinkedIn I was asked about how to clear fields using Power Automate, by Matthew Bourne working at Heathrow.
Creating list items
Table of Contents
This is not nice. But help is near. Using the HTTP request I can clear the people field by setting the StringId to an empty string and the Id to -1

Updating List Items
When I run this flow an item will be created and I can use the ID of this item to update my list item.

Managing required fields
The first pain is already visible. The Title field is a required field and I can’t save my flow. I can create a view without the Title field however that will still not help me. The required Title field still appears in the update item action

To work around this issue I’m going to set the Title to the title of the created item

Looking at the item created in SharePoint I’ve now got the described result. Even though I left fields blank the updated item will have the values set as specified in my create an item action.

Clear fields
How do we now set values to blank?

With Choice fields and many other field types I can simply set the value to null and as shown below the Choice field is cleared.

Having built up my confidence I’m just going to set all fields to null. Easy Job done! …

… or maybe not. When I ran the above flow I found that the update item action now failed.

Looking at the detail of the failing action, I got an error on the user field:
The specified user could not be found
This is not nice. But help is near. Using the HTTP request I can clear the people field by setting the StringId to an empty string and the Id to -1

So now it is up to you to either update all fields using the HTTP request action or to just use this for people fields. Both option are perfectly valid.
Note: in the above example MERGE is case sensitive.
Clear Managed Metadata fields
And then you want to clear the value of a managed Metadata field…. Well, using the null value isn’t going to work.
To clear a managed metadata field you will need to use the following expression:
concat('')
Yes, that is how easy it can be. Just set it to an empty string and the managed metadata field will be cleared.
Wouldn’t it be nice if the way to clear fields was the same for all types of fields?
Other related posts
Discover more from SharePains
Subscribe to get the latest posts sent to your email.