cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Suchitra1996
Resolver II
Resolver II

Batch SharePoint API Calls from power automate

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

7 REPLIES 7
jinivthakkar
Super User
Super User

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

v-litu-msft
Community Support
Community Support

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
Super User
Super User

@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-m...

 

Please help

 

jinivthakkar
Super User
Super User

@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
Resolver II
Resolver II

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.

 

DataChronicles
New Member

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
Frequent Visitor

swiftinitdotcom_0-1637755083579.png
can you please share?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Kudoed Authors
Users online (1,484)