Select to view content in your preferred language

ArcGIS Online Webhook with MS Power Automate (Flow)

3627
11
02-09-2021 03:02 PM
Danielle_Journey
Regular 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!!

11 Replies
David_Vogel
Occasional Contributor

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
Regular 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
Regular Contributor

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

0 Kudos
Danielle_Journey
Regular Contributor

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

0 Kudos
JulieK
by
Regular Contributor

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

0 Kudos
Danielle_Journey
Regular 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
Regular Contributor

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

MeganHicks
Occasional Contributor

Hi Danielle, I am trying to do something similar and am not having any luck with Power Automate. Would you mind sharing your scripts? Thank you!

0 Kudos
CalebCarpenter_MBI
New Contributor

@JulieK - I would like to know how you went about getting this resolved through Power Automate. Do you mind sharing?

@Danielle_Journey - Do you mind sharing those Python scripts you mentioned? I am trying to determine which way is going to be better for me.