Site icon Anj Cerbolles

Batch Update of SharePoint List item using Power Automate

As I’m looking to find a way to optimize the application to update an item from Excel table to SharePoint, I stumbled upon a great article created by Paulie, MVP. The article describes creating a SharePoint List item using the batch requests with the REST APIs implemented in Power Automate. (Check out the reference to learn more)

Before I start the article, I would like to thank Paulie for helping me during this time when I built this Flow. I had a great one-on-one MS Teams session with him when I got stuck with an issue with the REST API and got some tips and tricks from him. Thank you so much for your great help!

So in this article, we will do a batch update to a specific item in SharePoint. I modified the action and expressions in Flow, in which it will update a particular item in the list.

Requirement:

The Excel file is stored in a document library. If the data from Excel exists in the SharePoint list, update the Start Date and Description of the item. Let’s assume the ‘Title’ field has a unique value. We will use the BATCH API to update the item.  

Sample data in Excel file

In the ‘Actions in Flow’ section, I’m going to use this format ex. [Compose] settings which means [Action Name] Renamed Action.

Actions in Flow:

List rows present in a table
Add this outside of the ‘Apply to each’
Add ‘If condition’ after the ‘Filter array’

What’s inside of ‘Do until’ condition

*From: take(skip(body('Filter_array'), mul(outputs('settings')['batchSize'], iterationIndexes('Do_until'))), outputs('settings')['batchSize'])

* Map: replace(replace(outputs('Template'), '|RowData|', string(item())), '|ID|', string(item()['ID']))


SP Batch Item update flow

Conclusion:

Working with REST API is daunting, but you could do many things, especially when you want to optimize your flow. Another tip to maximize your flow is to minimize using ‘Apply to each' in your flow and using variables. 😉

Let me know if you have questions and have fun building! 🥂

You can download the flow here.

Reference:

Featured Image by ThisIsEngineering from Pexels

Exit mobile version