Skip to main content
Power Automate
    • Connectors
    • Templates
    • Take a guided tour
    • Digital process automation
    • Robotic process automation
    • Business process automation
    • Process advisor
    • AI Builder
  • Pricing
  • Partners
    • Blog
    • Documentation
    • Roadmap
    • Self-paced learning
    • Webinar
    • Business process and workflow automation topics
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • User groups
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Microsoft Power Automate Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power Automate
    • General Power Automate Discussion
    • Using Connectors
    • Building Flows
    • Using Flows
    • Power Automate Desktop
    • Process Advisor
    • AI Builder
    • Power Automate Mobile App
    • Translation Quality Feedback
    • Connector Development
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Galleries
    • Community Connections & How-To Videos
    • Webinars and Video Gallery
    • Power Automate Cookbook
    • Events
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Community Engagement
    • Community AMA
    • Community Blog
    • Power Automate Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power Automate Community
    • Galleries
    • Power Automate Cookbook
    • Batch Update SharePoint List

    Batch Update SharePoint List

    11-27-2021 16:55 PM - last edited 03-15-2023 10:09 AM

    Super User takolota
    Super User
    13792 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    takolota
    Super User takolota
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Batch Update SharePoint List

    ‎11-27-2021 04:55 PM

    Batch update with external data template flow.

    Explanation Video: https://youtu.be/l0NuYtXdcrQ 

    Compared to the using the basic Apply to Each, Get items, & Update item approach on large amounts of data, this method requires a small fraction of the API calls towards the daily action limit and drastically reduces flow run-times.


    It's currently set to take data from any Excel sheet and update records in SharePoint with corresponding data. It works with any potential Power Automate data-source, including HTTP API GET requests, but Excel provides a simple example.

    Part of it works like a Vlookup function where it identifies if a row of updated data in Excel has some set values in it and matches it to the SharePoint record with those set values through the SharePoint ID. Then it uses the batch update method to update those SharePoint records.

     

    The flow can easily expand to any size of SharePoint list by adding more Get items actions and batch update parallel branches. If speed is a concern for anyone, there are ways to make the Get items actions all load in parallel too (up to 50 branches). It's really only limited by how much effort people want to put into their flows & lists.

     

    Version 1.5

    This version makes it easier to handle cases where the list name may have changed since its creation and moves a few of the primary key column matching inputs to the 'settings' compose action so users don't have to look through & edit the more complicated expressions to set up the flow.

    Google Drive Link to Flow Zip Files: https://drive.google.com/file/d/10p7EB730xsEj-azVYuTIuu8dS0w-AflR/view?usp=sharing 

    Google Drive Link to Text File to a Scope Action Containing The Flow: https://drive.google.com/file/d/1BVGoeM5mykYlMobAyFkhuLRh3r7jMSLz/view?usp=sharing

     

     

    Version 1

    Download The Template Batch Update Flow

    Google Drive Link to Flow Zip Files: https://drive.google.com/file/d/10gFkycdx6zpRfrI-s_jCDwIK6dpyyDqk/view?usp=sharing

    Google Drive Link to Text File to a Scope Action Containing The Flow: https://drive.google.com/file/d/1e6-INUykIT22ppVh5m4kxz8us_7qXy7q/view?usp=sharing

     

     

    ***LISTS WITH UNDERSCORES _ IN THE TITLE MAY CAUSE ERRORS WITH EARLIER VERSIONS OF BATCH ACTIONS.***
    If you have a list with underscores in the name, then in TachyTelic.Net's batch create you will want to go to the __metadata line on the GenerateSPData select action and substitute the expression

    json(concat('{"type":"SP.Data.', replace(outputs('settings')['listName'], ' ', '_x0020_'), 'ListItem"}'))

    for

    json(concat('{"type":"SP.Data.', replace(replace(outputs('settings')['listName'], '_', '_x005f_'), ' ', '_x0020_'), 'ListItem"}'))


    TachyTelic.Net Blog & Videos
    Batch Create Flow
    Blog: https://www.tachytelic.net/2021/06/power-automate-flow-batch-create-sharepoint-list-items/ 
    Video: https://youtu.be/2dV7fI4GUYU

     

    Batch Delete Flow
    Blog: https://www.tachytelic.net/2021/06/power-automate-delete-sharepoint-items/ 
    Video: https://www.youtube.com/watch?v=2ImkuGpEeoo


    Formulas For Random Number Columns
    SharePoint Rand1To50 Column Calculated Default Value Formula:
    =INT(INT(RIGHT(NOW(),2))/2)

    Excel Random Column Formula:
    =ROUNDDOWN(((Rand()*100)+1)/2, 0)

     

     

    If the batch call succeeds, but individual rows fail to load to SharePoint, then the flow will not throw an error. I personally change out the Results Compose actions with Append to variable actions and use an expression that returns the results text if it identifies an error. Then at the end of the flow I have a condition checking the length of that variable. If it has some text/length to it, then something failed and it sends me an email with a link to the flow run.
    Expression to conditionally return results on failure:

     

    if(
    or(
    or(
    or(
    or(
    or(
    or(
    or(
    or(
    contains(base64ToString(body('sendBatch')['$content']), '400 Bad Request')),
    contains(base64ToString(body('sendBatch')['$content']), '401 Unauthorized')),
    contains(base64ToString(body('sendBatch')['$content']), '403 Forbidden')),
    contains(base64ToString(body('sendBatch')['$content']), '404 Not Found')),
    contains(base64ToString(body('sendBatch')['$content']), '408 Request Timeout')),
    contains(base64ToString(body('sendBatch')['$content']), '409 Conflict')),
    contains(base64ToString(body('sendBatch')['$content']), '500 Internal Server Error')),
    contains(base64ToString(body('sendBatch')['$content']), '502 Bad Gateway')),
    base64ToString(body('sendBatch')['$content']),
    '')

     

     

    watch?v=l0NuYtXdcrQ

    BatchUpdateV1.5.zip
    Labels:
    • Labels:
    • Button flows
    • Scheduled flows
    • Solutions
    Message 1 of 64
    13,792 Views
    9 Kudos
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    • « Previous
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
    • Next »
    roverton
    roverton
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-18-2022 02:52 PM

    No errors, just the 204 no content on the results

     

    roverton_0-1668811869448.pngroverton_1-1668811948059.png

    roverton_2-1668812010824.pngroverton_3-1668812061643.png

     

     

    Message 31 of 64
    387 Views
    0 Kudos
    Reply
    takolota
    Super User takolota
    Super User
    In response to roverton
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-18-2022 02:59 PM

    @roverton 

    Thanks, can you show what the inputs are for the SendBatch action in the run?

    Message 32 of 64
    384 Views
    0 Kudos
    Reply
    roverton
    roverton
    Frequent Visitor
    In response to takolota
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 06:28 AM

    I did not change it from what you had

     

    roverton_0-1669040923927.png

     

    Message 33 of 64
    375 Views
    0 Kudos
    Reply
    takolota
    Super User takolota
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 06:40 AM

    @roverton 

     

    No that’s the edit menu / action logic, when the flow runs what does the input or data look like going into the SendBatch action?

    Message 34 of 64
    373 Views
    0 Kudos
    Reply
    roverton
    roverton
    Frequent Visitor
    In response to takolota
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 06:43 AM

    Here go

     

    roverton_0-1669041781439.png

     

    Message 35 of 64
    368 Views
    0 Kudos
    Reply
    roverton
    roverton
    Frequent Visitor
    In response to takolota
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 06:59 AM

    I checked to see if the values were changing while getting the 204 no content error and to my surprise the field values are updating.

    Message 36 of 64
    361 Views
    0 Kudos
    Reply
    takolota
    Super User takolota
    Super User
    In response to roverton
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 07:01 AM

    @roverton 

     

    Alright I see the body of the requests contains some kind of data, so it’s not sending a blank request.

     

    And reading into the HTTP status codes, it says a 204 response is a successful response, but the system doesn’t need to send any response back to the call / flow for it.

    Is the data successfully updated when you run this?

     

    Alternatively, some of these documents mention this may happen if someone is simultaneously editing the data. Does any user or program have the list up in edit mode or something while you run this?

     

    https://restfulapi.net/http-status-204-no-content/

    https://www.webfx.com/web-development/glossary/http-status-codes/what-is-a-204-status-code/

    https://blog.ploeh.dk/2013/04/30/rest-lesson-learned-avoid-204-responses/

    Message 37 of 64
    358 Views
    0 Kudos
    Reply
    roverton
    roverton
    Frequent Visitor
    In response to takolota
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-21-2022 07:06 AM

    I am the only one working on this. Yes, surprisingly the data is being updated. However the status code is states the 204 no content. 

    Message 38 of 64
    355 Views
    0 Kudos
    Reply
    rbn_nue
    rbn_nue Helper V
    Helper V
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎12-27-2022 10:50 PM

    Hi @takolota ,

     

    Great article. I was able to use this in one of my flows and it works fine. Is there anyway we can use the batch query to update person or group column in SPO?

     

    Thank you.

    Message 39 of 64
    256 Views
    0 Kudos
    Reply
    takolota
    Super User takolota
    Super User
    In response to rbn_nue
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎12-27-2022 11:16 PM


    If something like this can pull all the potential users, then it may be possible to create something similar to the item Id value lookup for the person Ids

    https://pankajsurti.com/2020/10/12/how-to-update-people-field-using-send-an-http-request-to-sharepoi...

    Message 40 of 64
    250 Views
    1 Kudo
    Reply
    • « Previous
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
    • Next »

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign up free
    • Sign in

    Browse

    • Templates
    • Connectors
    • Partners

    Downloads

    • Mobile
    • Gateway

    Learn

    • Documentation
    • Learn
    • Support
    • Community
    • Give feedback
    • Blog
    • Pricing

    • © 2023 Microsoft
    • Contact us
    • Trademarks
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Terms & conditions
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices