How do you update a SharePoint list using power automate?

If you want to make any changes in SharePoint from Power Automate the Rest API is one of the best options to use. SharePoint has its own Rest APIs that can be used to create site/items/files/folders, or update site/items/files/folders, or to make any changes in the site or any update within SharePoint for which a Rest endpoint is available. So, you will use the Send HTTP Request to SharePoint action to send Rest API calls to perform any operation in SharePoint.

So first we will go through some basic operations as follows:

  1. Create List Item
  2. Update List Item

There is already a built-in action in Power Automate called Create Item to create a new list item in the SharePoint list, but creating a new List Item using Rest API call from Power Automate gives you more control and flexibility for example if you want to update the hyperlink column to have name Microsoft with link www.microsoft.com, then you wont be able to do it using Create Item, you will need to use REST API. Create Item will update both the name and URL with the link you provided in the hyperlink column.

So, add the Send HTTP Request to SharePoint action to your flow and configure your action as below:

How do you update a SharePoint list using power automate?

Let us understand the parameters of this action:

  1. Site Address: Provide the Site URL where your list resides.
  2. Method: POST (as we want to make changes in SharePoint)
  3. URI: _api/lists/getbytitle(Documents)/items/ (here in place of documents, put your List Title)
  4. Headers:
    1. content-type: application/json;odata=nometadata
    2. accept: application/json;odata= nometadata
  5. Body:
    1. Here is the main part, the values you need to set for the columns to create the list will go here, so in my example, I am setting four-column values: Title, Link, Notes, and Decision
    2. Title: This is a single line of text column so it will be a simple text value
    3. Link: This is a Hyperlink type of column, so you need to provide the value in the following format:
"Link": { "Description": "", "Url": "<actual link>" }</pre> <ol> <li>Notes: This is a multi-line text column so it will be a simple text value</li> <li>Decision: This is a choice column, so this will also be a simple text value from the choice options that you have configured for the column.</li> <li>The format of value will you provide here changes depending on the type of the column-like it will be different for the lookup column, Taxonomy, date, and so on.</li> <li>One more important point to note, that the column names that you provide here will be internal names of columns. How do you find the internal name of the column, go to your List Settings, then click on the specific column, then look at the browser URL, take the name that appears after the Field=</li> </ol> <p>E.g. <a href="http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099D945908A8%7D&Field=Link"><u>http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099D945908A8%7D&Field=Link</u></a>is my URL when I click on Link field in List Settings, here my internal field name is Link, which I will use in the body parameter.</p> <pre>Full Body Parameter value { "Title": "value", "Link": { "Description": "Microsoft", "Url": "http://www.microsoft.com" }, "Notes": "value", "Decision": "value" }</pre> <p>There is already a built-in action in Power Automate called Update Item to update existing list item in SharePoint list, but updating List Item using Rest API call from Power Automate gives you more control and flexibility like, Update Item action requires you to update all the mandatory columns even though you dont want to update those columns, and using REST API if you are required to update only those columns which you need to update. So, add Send HTTP Request to SharePoint action to your flow and configure your action as below:</p> <p><img src="https://www.annajhaveri.com/wp-content/uploads/2021/03/Picture2.png" alt="REST API to create and update SharePoint list items from Power Automate"></img></p> <ol> <li>Site Address: Provide the Site URL where your list resides.</li> <li>Method: POST (as we want to make changes in SharePoint)</li> <li>URI: _api/lists/getbytitle(Teams Requests)/items(ItemID) (here in place of Teams Requests, put your List Title, and in place of ItemID, put ID of your item)</li> <li>Headers: <ol> <li>content-type: application/json;odata=nometadata</li> <li>IF-MATCH: *</li> <li>X-HTTP-METHOD: MERGE</li> </ol> </li> <li>Body: <ol> <li>Here is the main part, the values you need to set for the columns to create the list will go here, so in my example, I am setting one column value: Status.</li> <li>Status: is a choice column in my list and I can simply provide a text value to update the choice column value.</li> <li>The format of value will you provide here changes depending on type of the column like it will be different for lookup column, Taxonomy, date and so on.</li> <li>Here again one more important point to note, that column names that you provide here will be internal name of columns. How do you find the internal name of the column, go to your List Settings, then click on the specific column, then look at the browser URL, take the name what appears after the Field=</li> </ol> </li> </ol> <p>E.g. <a href="http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099D945908A8%7D&Field=Status"><u>http://test.sharepoint.com/sites/test/_layouts/15/FldEditEx.aspx?List=%7BA4E78CC7-F74F-4733-832A-099D945908A8%7D&Field=Status</u></a>is my URL when I click on Link field in List Settings, here my internal field name is Status, which I will use in the body parameter.</p> <pre>Full Body Parameter value { "Status":"Approved" }</pre> <p>Thats it for now folks, thanks for reading the blog. There are many other REST API that I need to document, which I post on the blog in coming weeks.</p></div> </div> </div> </div>