Hi Henry Pelesh,
The webhook request sent by ArcGIS Online does not appear to contain a Content-Type : application/json in the header. This is why Power Automate considers it by default as application/x-www-form-urlencoded.
1- You can use this Request Body JSON Schema for your module When a HTTP request is received or generate schema from payload sample provided by Peter Klingman :
{
"type": "object",
"properties": {
"$content-type": {
"type": "string"
},
"$content": {
"type": "string"
},
"$formdata": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
]
}
}
}
}
After running a test, you should get this $formdata output :
[
{
"key": "payload",
"value": "[{\"name\":\"Power Automate\",\"layerId\":0,\"orgId\":\"<myOrgID>\",\"serviceName\":\"demoWebhook\",\"lastUpdatedTime\":1603875450774,\"changesUrl\":\"https://services.arcgis.com/<myOrgID>/ArcGIS/rest/services/demoWebhook/FeatureServer/extractChanges?serverGens=[24014837,24187488]&async=true&returnInserts=false&returnDeletes=false&returnAttachments=false\",\"events\":[\"FeaturesUpdated\"]}]"
}
]
Example :
2- To extract and parse the payload value, you can use Parse JSON module with this content as input (return the first element for the payload value in formdata) :
first(json(triggerFormDataValue('payload')))
or if your prefer :
first(json(triggerBody()?['$formdata'][0]?['value']))
or that
json(triggerBody()?['$formdata'][0]?['value'])[0]
And use this schema to parse the payload :
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"layerId": {
"type": "integer"
},
"orgId": {
"type": "string"
},
"serviceName": {
"type": "string"
},
"lastUpdatedTime": {
"type": "integer"
},
"changesUrl": {
"type": "string"
},
"events": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
Example :
After running a test, you should get this output :
{
"name": "Power Automate",
"layerId": 0,
"orgId": "<myOrgID>",
"serviceName": "demoWebhook",
"lastUpdatedTime": 1603875450774,
"changesUrl": "https://services.arcgis.com/<myOrgID>/ArcGIS/rest/services/demoWebhook/FeatureServer/extractChanges?serverGens=[24014837,24187488]&async=true&returnInserts=false&returnDeletes=false&returnAttachments=false",
"events": [
"FeaturesUpdated"
]
}
Now, you can use informations contained in the payload as dynamic content to request changesUrl, ... like this blog: Create a hosted feature service webhook