{
"type": "Foreach",
"foreach": "@body('Select')",
"actions": {
"Compose_Field_Name": {
"type": "Compose",
"inputs": "@items('Apply_to_each')"
},
"Compose_New_Item": {
"type": "Compose",
"inputs": "@triggerOutputs()?['body']?[item()]",
"runAfter": {
"Compose_Old_Status": [
"Succeeded"
]
}
},
"Create_item_in_Status_History": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"dataset": "https://mof1.sharepoint.com/sites/SubmissionsManagement",
"table": "3b12410c-dd4a-4300-a8b1-898e5f14aa24",
"item/Title": "@triggerBody()?['Title']",
"item/StatusChangedFrom/Value": "@outputs('Compose_Old_Status')",
"item/StatusChangedTo/Value": "@outputs('Compose_New2')",
"item/ProjectID/Id": "@triggerBody()?['ID']"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
"connection": "shared_sharepointonline",
"operationId": "PostItem"
}
},
"runAfter": {
"Compose_New2": [
"Succeeded"
]
}
},
"Compose_Old_Status": {
"type": "Compose",
"inputs": "@outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']?[item()]",
"runAfter": {
"Compose_Field_Name": [
"Succeeded"
]
}
},
"Compose_New2": {
"type": "Compose",
"inputs": "@contains(string(triggerOutputs()?['body']), item())",
"runAfter": {
"Compose_New_Item": [
"Succeeded"
]
}
}
},
"runAfter": {
"Send_an_HTTP_request_to_SharePoint": [
"Succeeded"
]
}
}