Update Item with HTTP request

How to clear fields in SharePoint list items using Power Automate

Yesterday on LinkedIn I was asked about how to clear fields using Power Automate, by Matthew Bourne working at Heathrow.

Creating list items

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

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

Clear 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

26 thoughts on “How to clear fields in SharePoint list items using Power Automate

  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.

  3. When I created the flow it tooks default ID number. Now i deleted the list and when I created the new items its ID starts with next number of previous one.It there any way we can reset start the Id again from “0”

  4. Hi – do HTTP POST’s reactivate workflows? I see above that there is an Update Item and then a HTTP Post. I’m need a HTTP to clear a Date field and was wondering how those calls reacted with Power Automate. Thanks.

  5. I think modifying a SharePoint item with a “Send an HTTP request to SharePoint” action would start any flow on it that runs when the item is modified…unless the trigger in the flow (“When an item is modified”) has a condition applied to it (in Settings for the trigger) so that if the item is modified by the account running the “Send an HTTP request” action (whatever connection that action is using; can select one from the 3-dot menu on the action — or by default it will be the account that created the flow), it doesn’t trigger the flow. Something like @not(equals(triggerBody()?[‘Editor’]?[‘Email’],’account_email@yourorg.com’))

  6. I’m not having any luck clearing choice fields with the null expression. It’s working fine for date fields and I’ve got the HTTP action working for clearing person fields. I guess I will try adding the JSON for choice fields in the HTTP action. Would it just be -1 for ID and ” for value?

  7. That is, I was able to set the choice fields to blank in the JSON using the internal column name and ”

  8. What I’m trying to is, that the person’s name it’s not auto-populating on the sharepoint list. Do you have any tips on that?

  9. How do I conditionally clear the people column field using http action? If there is a value in variable i would like to update it with value otherwise clear it. Can I use if condition within “Send http request” action? how?

    1. You would have to put the conditional logic in your flow. Not in your http request. You could first collect all items that you want to update and then do the update on those items though.

      1. I have only 1 item with 4 different person columns. All those are coming from variables. If variable has value, i got the column to update to variable’s value otherwise if the variable is blank the same needs to be updated to person columns. Do I need to write 4 different http request to sharepoint actions?

  10. Hi,
    Updating an item via Update Item will trigger any associated flows, but the Send HTTP Request will not! No need to use a functional account to work around this! I’ve looked into this…

    1. Hi Sara,

      I’ve just done a test and I’m not seeing the same behaviour. For me it doesn’t matter if I update using the Update Item or if I use the REST API through a send an HTTP request action. Please feel free to open a chat and we can have a look at the problem.

Leave a Reply

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

%d bloggers like this: