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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Help building Dynamic SharePiont HTTP body for /_api/web/$batch

(0) ShareShare
ReportReport
Posted on by 87

I am attempting to build a child flow to update various SharePoint lists using HTTP and the $batch APIs.  I have successfully created a flow that will update a single SP list however I require updating 8 lists.  I don't want to build individual flows for each list.

 

This is inspired by @takolota post  found here.

 

I can successfully pass a JSON formatted string to a child flow that describes the mapping between the new data and the SharePoint columns.  Like: (The number of fields varies between SP lists.)

[
 {
 "SourceField": "Field_x0020_1",
 "DestField": "TextFieldOne"
 },
 {
 "SourceField": "Number_x0020_Field_x0020_2",
 "DestField": "NumberFieldOne"
 }
]

 

What I wan to do is then use this mapping data to create the body of the update or insert JSON for the select step.  It should look like:

{
 "__metadata": @{json(concat('{"type":"SP.Data.', replace(outputs('settings')['listName'], ' ', '_x0020_'), 'ListItem"}'))},
 "ID": @{xpath(xml(outputs('XMLDestSPArray')),concat('string(//Array[Title/text()="', item()['Title'],'"]/ID/text())'))},
 "TextFieldOne": @{item()?['Field_x0020_1']},
 "NumberFieldOne": @{item()?['Number_x0020_Field_x0020_2']},
 "": "",
 "": ""
}

 

If this was a standard Algol language (C, Pascal, etc...) I would have a loop inside a look to create the JSON.

 

Any suggestions on how to accompanist this?

 

Thank you for your time.

I have the same question (0)

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 544 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 482 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 287

Last 30 days Overall leaderboard