ArcGIS Online Webhook with MS Power Automate (Flow)

732
7
02-09-2021 03:02 PM
Danielle_Journey
Occasional Contributor

I'm trying to set up a webhook in ArcGIS Online that will send an email when a feature has been created in a hosted feature service. I do not have portal/enterprise, so the only example that I have found is setting the webhook up with Integromat.  We have o365 and I would like to use Power Automate (MS Flow) to send the email.  I've been trying to follow the MS Flow steps in this example, but without success.  I copied and pasted this sample into my JSON payload:

 

{ "layerId":0, "serviceName": "myService", "changeType": "FeaturesUpdated", "orgId": "myorgId" "changesUrl": "https://olserver/services/myService/FeatureService/extractChanges?serverGens=[1122, 1124]" }

 

Which creates the following in 'When a HTTP request is received' (code view):

 

{
    "kind": "Http",
    "inputs": {
        "schema": {
            "type": "object",
            "properties": {
                "layerId": {
                    "type": "integer"
                },
                "serviceName": {
                    "type": "string"
                },
                "changeType": {
                    "type": "string"
                },
                "orgId": {
                    "type": "string"
                },
                "changesUrl": {
                    "type": "string"
                }
            }
        }
    }
}

 

I then have the next step to send an email to my email account. 

Danielle_Journey_0-1612911137280.png

I added the hookurl to my webhook with "ChangeTypes" = FeaturesCreated.  The webhook created successfully, but no email is sent when the hosted feature layer has a feature added to it.

If you have done something similar to this workflow, any guidance would be much appreciated!!

0 Kudos
7 Replies
David_Vogel
New Contributor II

Mostly experienced with Survey123 and Power Automate.  You said the email never gets sent, but does the actual flow get called? If so can you show the error being produced on the trigger event?

0 Kudos
Danielle_Journey
Occasional Contributor

I get zero runs logged and zero errors.  I've added three features to the hosted feature service as a test.  I've tried hitting the test manually button in Power Automate and it just spins for a long time, no action.  Without an error message, I don't know if I've not set up my webhook in the Rest Service incorrectly, or if I have not set up the "When an HTTP request is received" trigger in Power Automate correctly? 

0 Kudos
JulieK
by
Occasional Contributor

@Danielle_Journey  Were you able to get this webhook on feature service to work with Power Automate?

0 Kudos
Danielle_Journey
Occasional Contributor

@JulieK  No I ended up using python scripts to generate the email notifications. 

0 Kudos
JulieK
by
Occasional Contributor

aah okay, it doesn't seem to work for me in Power automate.

0 Kudos
Danielle_Journey
Occasional Contributor

Once I decided to go the python route with Windows Task Scheduler I was up and running and have had no issues.  I can share my scripts if you're interested, just let me know. 

0 Kudos
JulieK
by
Occasional Contributor

Thanks so much @Danielle_Journey  I got it to work finally 🙂