Update Item with HTTP request

Microsoft Flow – How to clear fields in SharePoint list items

Yesterday on LinkedIn I was asked about how to clear a people field using Microsoft Flow, by Matthew Bourne working at Heathrow.

These kind of things can be a real challenge. When you update a list item an empty value simply means ignore this field. To go through the issues here I will start by creating a flow that creates an item in a SharePoint list.

Creating list items

Creating a SharePoint list item with Flow

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.

Updating SharePoint list items with a flow

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

Update items having required fields

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

Setting the Title to the existing Title value

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.

List items in SharePoint

Clearing fields

How do we now set values to blank?

Clearing fields in SharePoint

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.

Choice field has been cleared

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

Setting all fields to null

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

Now my flow fails to run

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.
Update Item with HTTP request
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.

Other related posts

Microsoft Flow – Update a List item with a people field using REST API in the Send an HTTP request to SharePoint action

SharePoint / Microsoft Flow – User guide to using the SharePoint REST API in Microsoft Flow for no-code developers

6 thoughts on “Microsoft Flow – How to clear fields in SharePoint list items

  1. Hi Peter,

    What about clearing a date field using flow? My use case is for an approval scenario where a timestamp field gets set. It’s a date field, unfortunately, and the app is already in production. I’m actually trying to replace a 2010 workflow that was previously used for this.

  2. It worked after modified the list name in send http action (the list name is case sensitive, I kept first letter capital, actually it’s not).
    Sorry for the late reply.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: