An email notification can go a long way when monitoring field activity—alerting you when an inspection is completed, a new asset is collected, an incident is observed during an event, or anything else you need to be made aware of.
With Integromat, a free third-party service, you can create a webhook that automatically sends an email every time a feature is created, updated, or deleted in ArcGIS Field Maps. Follow this step-by-step blog post to create your own webhook like the one shown below:
For this example, you’ll create a map for debris reporting and a webhook that sends an email every time a report is submitted.
Create the layer and map
First, you’ll create the layer and map used to collect debris reports in the Field Maps mobile app. Browse to ArcGIS Online and sign in to your account. The Field Maps module in Integromat is not currently supported on ArcGIS Enterprise.
On the Content tab, click New item.
Click Feature layer, then select Use a template and click Next. In the Create a feature layer window, search for and select Debris Reports.
Click Next and follow the on-screen instructions for creating the layer. Accept all the default options and title the layer ‘Debris Reporting’. Once you click Save, the feature layer is created and added to your content.
On the item page for the new Debris Reporting layer, click Add to new map in the Open in Map Viewer drop-down menu.
Map Viewer opens with the Debris Report layer.
Click Save, provide a title for the map, and click Save map. Then click Share map and share the map with either your organization or a testing group. You’ll use this map to collect a point in the Field Maps mobile app when testing the webhook. Once you share the web map, open a new tab in your browser.
Create the webhook
Browse to integromat.com and create a free account if you haven’t already. Once you sign in, click Create a new scenario to get started.
In the window that appears, search for ‘Field Maps’ and select ArcGIS Field Maps. Click Continue. Click the module icon in the middle of the screen and select ArcGIS Field Maps from the menu. You’re given two options for the module: a trigger called Watch Features and an action called Make an API Call.
For this workflow, select the Watch Features trigger. This allows the webhook to watch for features being updated in Field Maps.
The Make an API Call action is used to retrieve information from ArcGIS Web Services. You can learn more about using this module in the Make an API Call documentation.
After clicking Watch Features, the module icon changes to the Field Maps logo and you can begin setting up the webhook.
Click Add and the Add a hook window appears. Fill out the following:
- Webhook name—Provide a name for the webhook that is unique to the project or map you’re configuring the webhook for.
- Connection—Click Add to connect to your ArcGIS account. Type ArcGIS for the connection name and click Continue to sign in to your account. You’ll only have to do this once.
- Feature Layer—Select the Debris Report feature layer you created earlier.
- Trigger events—Select what events trigger the module. You can choose one or more of the following: Features Created, Features Updated, or Features Deleted. For this example, check Features Created.
Click Save to save your webhook.
Next, you’ll add an Iterator module. This allows the webhook to iterate through an array of features if multiple features are returned at once. For example, if multiple mobile workers add new reports around the same time, an iterator ensures each report generates its own email notification.
In the Tools section, click Flow Control.
From the list of options, select Iterator. The Iterator module is automatically added to the webhook and connected to the Field Maps module.
Click the Array text box. Using the drop-down menu under ArcGIS Field Maps – Watch Features, find and select Adds .
Next, you’ll add an email module. Next to the Iterator module, click Add another module. Search for the email provider you use. For this example, I’ll search for and select Microsoft 365 Email.
From the list of options, choose Create and Send a Message.
In the Microsoft 365 Email window (or email module you chose), connect to your account and provide a subject, body content, and email recipients. You can use mapping to include attributes from the layer to format the text boxes. You’ll map the attributes from the Iterator module output. Provide the following information in the email:
- Subject—Add the Type of Debris attribute from the Iterator module output to include the debris type in the subject line
- Body Content—Provide some information about the report, including both the Type of Debris and Details attributes. You can format the body of the email using HTML.
- To Recipients—Add the Email attribute from the layer as well as an email for the back office. An email will be sent to the mobile worker as well as whoever is monitoring field activity.
The window should look something like this:
Click OK to save the email module configuration. With that, the scenario is complete and ready to run!
Test the webhook
To test the webhook scenario, you’ll add a new debris report in Field Maps. This will trigger the webhook to start and send an email to the specified address. To begin testing the scenario, click Run once.
The ArcGIS Field Maps module is now watching for a feature to be added in the Field Maps mobile app. On your mobile device, open the Field Maps mobile app. Sign in to your account and open the Debris Report map you created earlier.
On the map, tap the Add button and select any of the debris report feature templates. Fill out the form, making sure to fill out the Details and Email fields (as shown below). Remember, the email address you provide is where the email will be sent once the webhook is triggered.
Tap Submit and the scenario in Integromat is triggered.
The Field Maps module retrieves the new report, and an email is sent to the specified address.
Check your email inbox to see if the scenario worked. Click Save and save the webhook. You can use the Scheduling toggle button to activate your scenario. If you set the schedule to Immediately, the scenario runs each time a debris report is completed.
This is just one way to use the Field Maps module to automate a workflow. You can also use it to query feature layers, add features to a layer, and more. For more information, see the Automate Field Maps topic.
What will you automate with the Field Maps app for Integromat? Let us know in the comments below!