Select to view content in your preferred language

Use webhooks to automate workflows in ArcGIS Field Maps

4574
25
03-24-2021 07:27 AM
by Anonymous User
Not applicable
3 25 4,574

The Field Maps team has been researching ways to leverage webhooks to help automate various workflows. As part of that effort we've published this blog post which introduces key concepts and then guides you through the ins and outs of configuring a webhook that works with ArcGIS Field Maps and Integromat to improve and automate key workflows.

We'd love to understand what type of workflows you'd like to automate. Please share any requirements you may have as that can help us shape the work we do in this area.

25 Comments
AndrewBowne
Frequent Contributor

Right now we are doing inspections using both Field Maps and Survey123.  A user selects a space (indoors), clicks a link on the popup which fires off Survey123.  The survey is completed (as a related record to the space) and then fires off an Integromat Webhook.  Integromat evaluates the inspection information and determines if it's a pass or fail.  It also determines who the responsibility party is.  An email is then generated and send to the responsible party with a feature report.

Ideally, we'd like to reproduce this entire workflow in Field Maps and not have to use two separate apps.

Another use case would be doing Call Before You Dig requests in the field.  Once the CBYD is collected, email off the form to the applicant and internal stakeholders.  This is something we are doing with S123 now and would like to do with FIeld Maps.

DEI
by
Frequent Contributor

I agree with AndrewBowne. Based on feedback, our users would prefer one app. We have a similar work flow using both Field Maps and Survey123 but are currently trying to revise using only Field Maps. Field crews perform quarterly staggered inspections and based on the results (pass/fail) an email is sent via Integromat to management. 

DEI
by
Frequent Contributor

Hello!

In Field Maps I have a hosted feature layer that contains ID and location information and 6 related inspection tables (GlobalID to GUID, 1:M). Field crews inspect each location every quarter and take a reading. If the reading passes, they can move on to the next location. If it fails, they need to perform the next inspection. If that inspection passes, they move on to the next location. If it fails, the next inspection is required and so on…

I’ve been successful in setting up a webhook that will trigger an email notification via Integromat every time one of the inspections fail by following along with these blogs:

https://www.integromat.com/en/help/app/webhooks

https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/use-webhooks-to-automate-workflo...

https://developers.arcgis.com/rest/services-reference/online/web-hooks-feature-service-.htm

https://www.esri.com/arcgis-blog/products/arcgis-online/sharing-collaboration/how-to-create-a-hosted...

What I haven’t figured out is how to include the related hosted feature layer ID and location data in the email so that the failed inspection can be properly identified. I’m able to email the failed reading and date of inspection from the tables but no frame of reference (from hosted feature layer). I tried an HTML query module but that returned every location – I just want the one location that failed. My work-around solution to this point has been to include a link to the web map. Is it possible to include data from the hosted feature layer with the related table in an email via Integromat?

by Anonymous User
Not applicable

@DEIThat is definitely possible. You'll need to use the HTTP module to make a query request to the related feature layer. You can specify the where clause to be:

GlobalID = '<the GUID for the inspection feature>'

Like this:

AaronPulver_0-1629414326156.png

It will return an array with a single feature which you can then use.

DEI
by
Frequent Contributor

You are brilliant @Anonymous User !!!

That is exactly what I needed. I was missing the where clause.

Thank you!

 

erica_poisson
Frequent Contributor

@Anonymous User -

When will support in Power Automate be available?

by Anonymous User
Not applicable

@erica_poisson 

You can use Power Automate today, the steps are pretty similar except for how you authenticate. I'm actually planning to publish another blog post this week or next week that walks through how to use Power Automate.

erica_poisson
Frequent Contributor

@Anonymous User - thank you! I currently use Power Automate with Survey123... I guess I am just curious what the trigger would be here. It's exciting this will be possible now!

by Anonymous User
Not applicable

@erica_poissonyou can use the "When a HTTP request is received" trigger to start the flow.

erica_poisson
Frequent Contributor

@Anonymous User thanks. It looks like that might be a Premium connector that my organization has not approved to appear in our list of connectors within Power Automate or I am not seeing it appear when I search the Connectors). I will look for your blog sometime over the next two weeks to get more details before making a request to add this connector into our tenants. 

by Anonymous User
Not applicable

@erica_poissonYes I believe it along with some of the other necessary actions are Premium features. I published the blog post yesterday.

DEI
by
Frequent Contributor

@AaronPulver 

I saw that Integromat released a beta Field Maps module. I tried to incorporate an HTTP query request to return data from the hosted feature layer but get a ‘token required’ error. Do you have any suggestions on how to set up a scenario (similar to my earlier post above) using this new module?

by Anonymous User
Not applicable

@DEI 

Absolutely, I built the Field Maps Integromat app 😀

You can use the Make an API Call module to make an authenticated API request to any federated service (hosted services, basemaps, etc) or to the sharing API (maps, users, etc).

In your case you should reference the "Connect the Make an API Call action to your ArcGIS organization" section of the doc. You'll need to include the sub-domain of "services<X>" when you create your connection. This will allow that connection to make API requests to hosted services. Replace X with whichever number your hosted services are hosted on.

Then you will configure the Make an API module to use that connection and use the relative URL to the query endpoint. The rest should be the same as before. It will look something like this:

AaronPulver_0-1631748119043.png

We'll have some more blog posts coming out soon to show some scenarios that use this module.

DEI
by
Frequent Contributor

@AaronPulver 

Thank you!!! 👍

AndrewBowne
Frequent Contributor

@Anonymous User  - This is great!  Integromat integration (webhooks) are proving to be a huge asset to our workflows.   

Any thoughts on when we might see this available for ArcGIS Enterprise/Portal?

by Anonymous User
Not applicable

@AndrewBowneWe expect feature service webhooks to be available in the release following 10.9.1 (so 10.10 or whatever the release ends up being). At that time we'll update our Integromat app to support ArcGIS Enterprise.

DEI
by
Frequent Contributor

@AaronPulver 

The new Field Maps module is awesome!

I've been testing a few different scenarios one of which returns an 'Invalid token' error (image attached) every so often. The simple 2 module scenario connects a FM watch features trigger to send an email. When I go to restart, it runs fine for a while and then will send the error seemingly at random. Do you have any thoughts on why it would behave this way? 

 DEI_0-1631882935070.png

 

by Anonymous User
Not applicable

@DEIIf you open the failed run and open developer tools in your browser, you should see messages logged to the console. These messages contain the sanitized requests and responses. Can you see which request is returning the invalid token error?

Here's a screenshot of what I mean.

AaronPulver_1-1631886692087.png

 

DEI
by
Frequent Contributor

@AaronPulver 

Is this what you're looking for?

DEI_0-1631887118751.png

 

by Anonymous User
Not applicable

Kind of @DEI are you opening a page for a specific scenario that ran/failed?

AaronPulver_0-1631892965581.png

You should see responses and requests logged and objects that you can drill into.

For example, I've expanded the request and response bodies for the generateToken request.

AaronPulver_1-1631893047366.png

 

DEI
by
Frequent Contributor

@AaronPulver 

I'm not seeing that on my end.

DEI_0-1631898023372.png

 

JWilson
New Contributor

@Anonymous User I followed your blog post workflow for creating assignments in workforce from new inspections, but I'm having trouble with the call API module for Field Maps.

 

I was able to establish a connection to the data and create email notifications for when a new inspection was created, but when I try to get the create assignments scenario to run I get an error on the call API step.

 

UPDATE: Integromat responded to my support request. The issue is actually a problem with generating a token by the module, and they've forwarded my request to the dev team. Any advice on possible fixes would be greatly appreciated.

 

The error is:

ArcGIS Field Maps - Make an API Call

The operation failed with an error.

Error

ENOTFOUND: Service is temporarily unavailable.

 

JWilson_0-1635490459411.png

 

by Anonymous User
Not applicable

@JWilsonyeah I saw that ticket come through; I'll look into it.

JessicaWay1
Occasional Contributor

Can you set up a webhook connection with Power Automate and Portal 10.8.1? Or is the blog article only for 10.9.1?

by Anonymous User
Not applicable

@JessicaWay1This article only applies for ArcGIS Online. There is active development to support webhooks with the next version of ArcGIS Enterprise. So hopefully this summer you will be able to connect ArcGIS Enterprise with Power Automate and Integromat.