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.


Report
All responses (
Answers (