web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Batch SharePoint API C...
Power Automate
Unanswered

Batch SharePoint API Calls from power automate

(0) ShareShare
ReportReport
Posted on by 185

Hi,

 

I'm trying to implement the batch API calls to sharepoint list to create new items. The flow is getting executed successfully but the items are not getting created and I'm getting the below output from the http request .

 

{
 "$content-type": "multipart/mixed; boundary=batchresponse_cace2e0f-7b35-4382-af00-ad932f9e8888",
 "$content": "LS1iYXRjaHJlc3BvbnNlX2NhY2UyZTBmLTdiMzUtNDM4Mi1hZjAwLWFkOTMyZjllODg4OC0tDQo="
}

 

 

Originally, I wanted to add data from excel but for testing purpose, I hard coded the values (body below)

 

--batch_cd329ee8-ca72-4acf-b3bf-6699986af544
Content-Type: multipart/mixed; boundary="changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc"
Content-Transfer-Encoding: binary
 
--changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc
Content-Type: application/http
Content-Transfer-Encoding: binary
 
POST https://<tenant>.sharepoint.com/sites/<site>/_api/web/lists/GetByTitle('<title>')/items HTTP/1.1
Content-Type: application/json;odata=verbose 
{
 "__metadata": {
 "type": "SP.Data.<title>ListItem"
 },
 "Title": "Test"
}
--changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc--
--batch_cd329ee8-ca72-4acf-b3bf-6699986af544--

 

 Please let me know where I might be missing something.

 

Thank you in advance

Categories:
I have the same question (0)
  • jinivthakkar Profile Picture
    4,187 on at

    @murshed @v-litu-msft I too tried everything nothing works, can you please post a working example ?

  • v-litu-msft Profile Picture
    on at

    Hi @Suchitra1996,

     

    I think the headers in your HTTP request are not correct, you could refer to by following screenshots to structure it:

    Screenshot 2021-02-12 133744.jpg

     

    For more details about lists and list items API, you could refer to this document, you will find the Create item API:

    Working with lists and list items with REST | Microsoft Docs

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • jinivthakkar Profile Picture
    4,187 on at

    @v-litu-msft thanks for your reply but I think the issue is with _api/$batch end point POST, the regular POST which you showed just works fine.

     

    The issue is with batch insert operation like this 

     

    https://ashiqf.com/2020/06/16/batch-sharepoint-requests-get-post-patch-delete-in-powerautomate-and-ms-graph/

     

    Please help

     

  • jinivthakkar Profile Picture
    4,187 on at

    @v-litu-msft one more similar blog/article but this also does not work :

     

    https://wiliammbr.com/batch-insert-items-in-sharepoint-with-power-automate/

     

     

  • Suchitra1996 Profile Picture
    185 on at

    Hi @v-litu-msft,

     

    This is the header of my request for the batch API request.

     

    I have entered the batch ID in the header request and the same batch ID is in the body of the request.

     

    Suchitra1996_0-1613114801593.png

    Suchitra1996_1-1613114871606.png

     

     

    I get the below output when I execute it:

    Suchitra1996_2-1613114915677.png

     

    While the flow ran successfully, there was no item created in the list.

     

  • Community Power Platform Member Profile Picture
    on at

    Did you get this resolved? I got batch posts working

    I can share if you are still trying to work on this I am typing on iPad right now but can share full solution if you need it

  • swiftinitdotcom Profile Picture
    14 on at
    swiftinitdotcom_0-1637755083579.png
    can you please share?
  • Kem-El Profile Picture
    2 on at

    Late to the game on this, but you simply need to add a blank line between the start and end of the JSON data.

     

     

    --batch_cd329ee8-ca72-4acf-b3bf-6699986af544
    Content-Type: multipart/mixed; boundary="changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc"
    Content-Transfer-Encoding: binary
     
    --changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc
    Content-Type: application/http
    Content-Transfer-Encoding: binary
     
    POST https://<tenant>.sharepoint.com/sites/<site>/_api/web/lists/GetByTitle('<title>')/items HTTP/1.1
    Content-Type: application/json;odata=verbose 
    
    {
     "__metadata": {
     "type": "SP.Data.<title>ListItem"
     },
     "Title": "Test"
    }
    
    --changeset_64c72699-6e7c-49c4-8d9b-6b16be92f7fc--
    --batch_cd329ee8-ca72-4acf-b3bf-6699986af544--

     

  • takolota1 Profile Picture
    4,974 Moderator on at

    Paulie provides a template for anyone trying to do this…

     

    https://www.tachytelic.net/2021/06/power-automate-flow-batch-create-sharepoint-list-items/?amp

    and there is also a batch update template…

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Batch-Update-SharePoint-List-With-External-Data/td-p/1365410

  • alexa_028 Profile Picture
    63 on at

    Hi @takolota 
    I am using same template as Paula's and now I am getting failure at send Batch with Bad HTTP request 400.
    I got this error message - 
    The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of 1055877 bytes has been read from the stream; however a maximum of 1048576 bytes is allowed.(…)

    I tried using batch size to 750 and even 50 , but still it is same. Can you pls help?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard