Push Data from ArcGIS Field Maps to an Application in Real-Time with Webhooks

Matt Meeboer
Matt Meeboer
  • Updated

FME Version

Introduction

ArcGIS Field Maps enable users to quickly create mobile solutions using their ArcGIS Online maps. When integrated with FME Server, the functionality of your Field Maps can be extended to send email notifications and data to other systems. With the ArcGISOnlineWebhookDataGetter transformer, you can process new, updated or deleted records from a Field Map’s Feature Service when a webhook payload is received from ArcGIS Online. This tutorial will go through the steps of connecting a Field Maps webhook to FME Server and webhook response handling in an Automation.
 

Requirements

Before starting this guide, we highly recommend that you have completed the FME Desktop Basic training. If you are new to FME Server and Automations, we also recommend reading our Getting Started with Automations article before continuing. You should also be familiar with how to add feature layers and maps in ArcGIS Online. In addition, the following are required:

  • ArcGIS Online account with permission to use the Admin REST API 
  • FME Server must be publicly available to receive webhook messages. If you’re using FME Cloud, no extra configuration is needed.
  • ArcGIS Field maps mobile app installed on an iOS or Android device
  • Gmail account to create a Gmail web connection

 

Scenario

You are a GIS specialist working for a small city that has been affected by a severe weather event. The city has inspectors who are surveying the area and reporting damage using ArcGIS Field Maps on their smartphones. The city also has a custom work order management system with a SpatiaLite database backend. 

You have been tasked to use FME Server to automate the work order creation by loading data into the SpatiaLite database whenever a record is added in Field Maps. The appropriate field crew chief must also be notified, so that they can complete the work order and then dispatch a crew to fix the damage.
 

Step-By-Step Instructions

Disclaimer: This tutorial was created using FME Server 2022.0. There may be some differences in the UI and terminology if you are using a different version, but the fundamentals are mostly the same. Screenshots from ArcGIS Online and Field Maps are also included, but may change without notice.

Before you begin, download the StormDamageBegin.fmw workspace from the Files section of this article. Note that the Workspace has several transformers that will need to be configured with your parameters before it will work.
 

Part 1: Create the Field Maps Application

The first step of creating our Automation is to set up the feature layer, web map and ArcGIS Field Map application.

1. Create a Feature Layer and Map

In a new browser tab, open ArcGIS Online. From the Content menu, click New item
AGOL Content

From the New item dialog, choose Feature layer. Then, select Create a blank layer. 
AGOL Feature Layer

Create a new point feature layer named "Storm Damage”. It’s okay to keep the default options selected. Click Next. Add a tag, then select Save. By default, the OBJECTID, GlobalID and Photos And Files attributes will be created. We’ll add the other attributes in Field Maps. 

Open the Feature Layer and click Settings
AGOL Feature Layer Settings

Under Editing, enable Keep track of changes to the data (add, update, delete features). Click Save.
AGOL Feature Layer Settings



Return to the Feature Layer Overview and click Open in Map Viewer Classic
AGOL Open Map Viewer Classic

The feature layer is added to a new map. Zoom to a city where damage will be reported in Field Maps, in this example, Vancouver, Canada. Name the map “Storm Damage”, the same as the feature layer, and save. 
AGOL Map Viewer Classic

There should now be a Storm Damage Feature Layer and Web Map in ArcGIS Online.
AGOL Layers

2. Create a Field Map Application

In Field Maps, click the Storm Damage map to open it. 
8_FIeldMaps.png

Click Content and then the Storm Damage layer. This will show the Field Maps Form Builder that we will use to design a form for inspectors to add and edit points where storm damage is found. The Form Elements on the right can be dragged onto the form and rearranged as needed.
9_FieldMapsLayer.png

Add the following elements to the form. Make sure Allow Editing is enabled for all fields (this is the default):

Form Element Display Name Field Name Type Length Required
Choice - Combo box Damage Type Damage_Type String 50 Yes
Text - Multiline Description Description String 1000 No
Text - Singleline Reported By Reported_By String 100 Yes
Date/Time Reported On Reported_On Date N/A Yes
Switch Status Status String 10 Yes


The list values for the Damage Type combo box are:

Label Code
Tree TREE
Sign SIGN
Traffic Light LT_TRAFFIC
Street Light LT_STREET
Power Line PWR_LINE


For the Status switch, the values are simply OPEN (switch off) and CLOSED (switch on). Default the value to OPEN.

Note: ArcGIS Online will automatically create attributes in the Storm Damage Feature Layer for the form elements added. 

Save your form. You can add placeholder text and field descriptions if you wish. The resulting form in the Form Builder should look like this:
10_FieldMapsForm.png

The status values are not displayed in the Form Designer. When viewed in the Field Maps mobile app, the status values (OPEN and CLOSED) are shown.
Field Maps Mobile App
 
The map will now be editable from within the Field Maps mobile or web application.

Note: for the purpose of this exercise, only your ArcGIS Online account will have access to the map in Field Maps, by default. In a real-world scenario, you could share the feature layer and map with the organization or a larger group.
 

Part 2: Connect the Field Maps Webhook to FME Server

We need to create an Automation in FME Server to handle the webhook payload that will be sent by the Storm Damage Feature Service when a point of damage is added in Field Maps. For more information on webhooks, please read our Webhooks and FME Server article.

1. Create an Automation in FME Server

Go to FME Server. From the side menu, click Automations and then Build Automation.

Double-click the Trigger. In the drop-down menu, select Webhook (triggered)
Build Automation

To get a webhook URL, you will need to save the Automation first. Save the Automation as "Field Maps Storm Damage". Click once again on the Trigger and you should now see the Webhook URL. This URL contains a unique token to give our Field Maps webhook the ability to access FME Server and run the Automation. Leave the parameter open, we will need to copy the Webhook URL when creating the ArcGIS Webhook.
FME Server Webhook URL

2. Enable the Webhook in ArcGIS Online
 
In ArcGIS Online, open the Storm Damage feature layer. From the Overview tab, scroll to the bottom of the right-hand menu to access the REST API URL. Click View to open a new tab containing the Storm_Damage "FeatureServer".  
 AGOL View Feature Server
To access the Feature Server Admin settings from a browser, manually edit the URL to insert “admin” between “rest” and “services”.
 AGOL Admin Feature Server URL

Press enter to submit the updated URL to the browser. Disclaimer: not much will appear to have changed! Scroll to the bottom of the page and click Web Hooks from the list of  Supported Operations.
AGOL Web Hooks Operation

Click Create.
AGOL Create Webhook Link

Note: If "Web Hooks" is not available as a supported operation:

  • double-check the edited URL
  • contact your ArcGIS Online administrator to ensure your account has admin privileges
  • ensure the Feature Service is not used in Survey123

 
3. Create the Webhook
 
Name the webhook. 
 
The Change Types specify what kind of feature layer changes will send messages to our FME Server Automation. For this article, we will only handle new points, but we’ll enter FeaturesCreated, FeaturesUpdated, FeaturesDeleted, in case you wish to process the other events later. The ArcGISOnlineWebhookDataGetter used later in this article can process all three types of events.
 
Note: Many types of events can send messages to an FME Server Automation. Review “Trigger event values” in the Esri documentation for all available options.
 
Copy the Webhook URL from the FME Server Webhook Trigger and paste it into the HookUrl.
 
Payload Format can be PJSON (“Pretty JSON”, for better readability).
 
Schedule Info can be left as default. Keep in mind that the “interval” key is set to 20. This interval setting hints that our webhook isn’t quite real-time. Instead, ArcGIS Online polls our Feature Layer for changes every 20 seconds. Feel free to increase the polling rate if it’s not critical to get updates ASAP. 
AGOL Create Webhook

Click the Create button. The webhook is created, but inactive.
AGOL Webhook Created
Note: if you receive an Invalid Token error, try logging out and back into ArcGIS Online.
 
Return to the Web Hooks page and click Activate All (leave the default Format as “HTML”).
AGOL Activate All Webhooks 
 
4. Create a Message Logger
 
Let’s test the webhook. In the FME Server Automation, add an Action, connect it to the Trigger’s Action Succeeded port, and then set the Action to Log a message.
 
Open the drop-down menu next to Formatted Message, expand Webhook, select Message Content, and then click Apply. This will log the entire webhook result message.
FME Server Log Message Content
 
Start the Automation.
FME Server Start Automation
 
5. Submit a Test Form from Field Maps
 
On a mobile device, open the Field Maps app. Tap on the Storm Damage map to open it. Fill and submit a form. 
 
In your Automation, open the Menu and click View Log File. In the log, you should see a result similar to the image below. The webhook is working!
Sample Webhook Payload
 
This is the webhook response message. Notice that the data you submitted is nowhere to be found in the response. Thankfully, there is a custom transformer, the ArcGISOnlineWebhookDataGetter, that can take this response and fetch the actual feature data we need. Next, we’ll create a workspace that gets the feature data, writes it to the SpatiaLite work order database, and notifies the responsible crew chief.  
 
Take note of the events key. This is an array of the types of events that have occurred since ArcGIS last sent a webhook payload for the Feature Service. If you recall, when we created the webhook in the ArcGIS Online Feature Server, the frequency was 20 seconds. In this case, there has only been a feature created since the last payload was sent, but it is possible to have additional event types in this array, if features were also updated and deleted. We won’t be using the events key, but it can be helpful to know this when troubleshooting.
 
If you do not see anything in the log after submitting your test form:

  • Confirm that the Automation is running
  • Wait at least 30 seconds and refresh the log
  • Open the webhook from ArcGIS Online and confirm it has been created and activated (revisit steps 2 and 3 in this part)
  • Confirm with your FME Server admin that your server is publicly available

Note: Every API is different. For an example of working with a more complex API JSON response that needs to be parsed into output keys, check out Automating Workflows from Survey123 to ArcGIS using FME Server.
 

Part 3: Process the Webhook Response in FME Workbench

With our webhook now working, we want to connect a workspace as the next action in our Automation to obtain the form data from the webhook response. Instead of making several manual REST API calls to do this, we’ll use a custom transformer from the FME Hub: the ArcGISOnlineWebhookDataGetter. To pass the message content from the Automation to our workspace, we will need to set up a user parameter in FME Workbench.
 
1. Create a New Workspace and User Parameters
 
Open a blank workspace in FME Workbench. Save the workspace as StormDamage.fmw. In the Navigator, right-click User Parameters and select Manage User Parameters. Click the Insert button and choose Text.
Create User Parameter
 
On the right-hand side of the Parameter Manager, enter the following parameter properties:

  • Parameter Identifier: webhook_message
  • Prompt: Webhook Message
  • Published: Enabled
  • Required: Disabled
  • Disable Attribute Assignment: Disabled
  • Default Value: Paste the webhook message from the Automation’s log file, from “payload=[“ to the closing square bracket (see Part 2, Step 5). This will be used for testing our workspace. 

Click OK.
 
2. Get the Webhook Response Message
 
Search for the Creator transformer and add it to the canvas. This will start the workspace in the Automation when the webhook is triggered.
 
We can grab the webhook message using the ParameterFetcher transformer. Attach a ParameterFetcher transformer to the Creator.
 
Open the ParameterFetcher parameters. For the Parameter Name, open the drop-down menu and select the webhook_message user parameter that we just created. Name the Target Attribute webhook_message. Click OK
Parameter Fetcher
 
Run the workspace with feature caching enabled and inspect the ParameterFetcher output. A new webhook_message attribute has been created with the response text we pasted into the webhook_message’s default value.
webhook message preview
 
3. Create an ArcGIS Online Web Connection
 
In FME Workbench, select Tools > FME Options. In the FME Options dialog box, select Web Connections and add a new web connection.
Add Web Connection
 
In the Edit Web Connection dialog, choose Esri ArcGIS Online as the Web Service. Enter a unique Connection Name - this is the name that will appear as a choice when selecting a web connection in the ArcGISOnlineWebhookDataGetter (and other transformers that can connect via a web service). Click Authenticate
Authenticate Web Connection
 
When prompted, enter your Esri ArcGIS Online Username and Password, and then click Sign In to create the Web Connection.
Web Connection List

Please read Web Connections and FME to learn more about web connections in FME.
 
4. Get the Feature Data from ArcGIS Online
 
Add the ArcGISOnlineWebhookDataGetter to the canvas. It is a custom transformer from the FME Hub and will accept the ArcGIS Online webhook message as input. Connect the ParameterFetcher to the ArcGISOnlineWebhookDataGetter and open the parameters.
 
For the Webhook Response Message, choose the webhook_message attribute. From the Web Connection drop-down list, choose your ArcGIS Online Web Connection. ArcGISOnlineWebhookDataGetter
 
Click OK and run the workspace. 
Workspace

Inspect the ArcGISOnlineWebhookDataGetter output in Visual Preview. There is now a _response_body attribute with the test form submission data. To take a closer look, double-click the _response_body value and format as JSON.
View Webhook Response
 
The ArcGISOnlineWebhookDataGetter has retrieved the feature attributes and point geometry for us as JSON. We could parse this to create the point feature, but first, let’s take a look at the Feature Information in Visual Preview. Turn on Feature Information if it is not currently visible:
Open Feature Information
 
In the Feature Information, we see that the ArcGISOnlineWebhookDataGetter has output all of the attributes we need in addition to the JSON, they just need to be exposed. The attributes from each JSON key - attributes and geometry - are prefaced with the name of the key.
Attributes
 
5. Expose the Attributes and Create a Point Geometry
 
Add an AttributeExposer to the canvas and connect it to the Adds port of the ArcGISOnlineWebhookDataGetter. Open the parameters and click Import > From Feature Cache…:
Import From Feature Cache
 
Check off all of the attributes that are prefaced by attributes and geometry, except for geometry.m, and then click Import.
Attributes to Import
 
The attributes are imported. Click OK.
Attributes Imported
 
6. Create a Point Geometry
 
A point geometry needs to be created from the coordinates. Add a VertexCreator to the canvas and connect it to the AttributeExposer. Open the parameters and set the x and y values to the geometry.x and geometry.y attributes.
VertexCreator
 
You may have noticed when we inspected the _response_body JSON earlier that the geometry key contained no spatial reference, just coordinates. ArcGIS Online uses the coordinate system from the basemap, which is WGS84 Web Mercator, by default, otherwise known as Spherical Mercator. We need to manually set the coordinate system, since FME doesn’t have enough information just from coordinates to determine it for us. 
 
Add a CoordinateSystemSetter to the canvas and connect it to the VertexCreator. 
Workspace
Open the CoordinateSystemSetter parameters. Set the Coordinate System to SHERICAL_MERCATOR. Click OK. 
Coordinate System Setter Spherical Mercator
 
Run the workspace and examine the results in Visual Preview. We now have a point feature with valid geometry and attributes. 
Workspace Run
Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.
 
Note: it is possible for an ArcGIS Online administrator to change the default coordinate system used in ArcGIS Online. If you’re not sure which coordinate system your organization is using for ArcGIS Online, check with your administrator.
 
7. Clean up attributes
 
Time to tidy up some attributes. The period in the attribute names makes them long and may be problematic when writing data. Add a BulkAttributeRenamer to the canvas after the CoordinateSystemSetter. In the parameters, set the Action to Remove Prefix String and then set the String to “attributes.”.
Bulk Attribute Remover
 
Add an AttributeManager. Remove the following attributes: 

  • _creation_instance
  • webhook_message
  • _reponse_body
  • geometry.x
  • geometry.y

Reorder the Output Attributes so that the GlobalID and OBJECTID are first and second. 
AttributeManager
Run the workspace and inspect the AttributeManager output in Visual Preview. The Feature Attributes are much cleaner now. 
Inspect Cleaned Attributes
 
8. Organize the Workspace
 
Create a bookmark around all of the transformers added so far, except for the Creator and ParameterFetcher. Name it "Create feature geometry". At this point, your workspace should look like this: 
Workspace
 

Part 4: Send the Notification Email and Write to the Database

In this part, we’ll configure our workspace to find the crew chief that needs to be notified, send her an email to notify her of the storm damage, and write the record to the SpatiaLite work order database.
  
1. Find the responsible crew chief
 
For demonstration purposes, our crew chiefs are in a .csv file found at the top of this article under Files. Download the crewchiefs.csv file and add a new reader to the canvas. Set the format to CSV and the dataset to the crewchiefs.csv file. Click OK.
CSV Reader
 
Note that a new published parameter was automatically generated named "SourceDataset_CSV". This will be used in our Automation to set the input source in the FME Server shared resources.
 
Run the CSV reader to build the feature cache. Inspect the results - there are five records, each listing the crew chief, their department and the type of damage their department is responsible for.
Preview CSV
 
Let’s join the crew chief data to our point feature. Add a FeatureJoiner to the canvas. Connect the CSV Reader to the Right input and the AttributeManager to the left input. 
Workspace
 
Open the FeatureJoiner parameters. Under Join On, join the Damage_Type from the Field Maps feature to damage type in the CSV file. Click OK.
FeatureJoiner
 
Run the workspace and inspect the Joined output. The information for the responsible crew chief has been added to the feature.
 
2. Convert the Reported Date
 
Now that we know who to notify, we can send an email with the information from the Storm Damage FIeld Map feature. Except, there’s a problem, you may have noticed that the Reported_On date is a long number, instead of a readable date. This will not make much sense to the crew chief. 
 
ArcGIS Online stores datetimes in an integer format called Epoch (or UNIX). We can convert this format to a readable format in FME using a DateTimeConverter. But, if we try to do this with the Reported_On number as-is, we’ll get this error:
Date Error
 
The datetime returned from ArcGIS Online has milliseconds. 
 
Add an AttributeCreator and connect it to the Joined output port of the FeatureJoiner. 
 
Open the parameters. Create a new attribute named Formatted_Date. For the Attribute Value, we’ll use a FME Math Function: click the ellipses (...) to display the Text Editor. Scroll down the function list and find the Math Functions. From the list of Math Functions, double-click div. Enter @div(@Value(Reported_On),1000) to divide the date integer by 1000 and convert the milliseconds to seconds. Click OK on the Text Editor and OK on the AttributeCreator.
AttributeCreator
 
Now the date can be converted by FME. Add a DateTimeConverter and connect it to the AttributeCreator. 
Workspace
 
Enter the following parameters in the DateTimeConverter:

  • Datetime Attributes: Formatted_Date
  • Input Format: %s$ (Epoch Time)
  • Output Format: ISO 

DateTimeConverter
Please note: the ISO Output Format displays a Z on the end of the time, for Zulu. This is because the date is in UTC time, which is synonymous with Zulu time. For the scope of this article, we won’t format the date any further, but please read Handling Local Timezones, UTC, Daylight Savings Time, and Leap Units if you’d like to learn more.
 
Run the workspace and inspect the DateTimeConverter output. There is now a Formatted_Date we can include in our email.
Preview Formatted Date
 
3. Send the email
 
Before we can send the notification email to the crew chief, we need an email service. For simplicity, we’ll use Gmail. Create a new Google Gmail web connection by clicking Tools >  FME Options. In the Options menu, click Web Connections, and then add a New Connection
Add Gmail Connection
 
Choose Google Gmail (safe.emailer) as the Web Service. Give the connection a name and click Authenticate…. You will be prompted to enter your Gmail credentials. 
Authenticate Gmail Connection
 
Once authenticated, the connection has been created. 
 
Return to the canvas and add an Emailer transformer. Connect it to the DateTimeConverter. In the Emailer transformer parameters, enter:

  • From: Reported_By
  • To: the email attribute (this is the crew chief’s email address from the csv file)
  • Subject: [ObjectID @Value(OBJECTID)] Storm Damage Added
  • Body: click the ellipses (...) next to Body and enter:
    @Value(crew chief):
    New storm damage reported in ArcGIS Online Field Maps. Details below.
     
    Damage Type: @Value(Damage_Type)
    Description: @Value(Description)
    Reported By: @Value(Reported_By)
    Reported On: @Value(Formatted_Date)
    Status: @Value(Status)
  • Email Service: Gmail
  • Gmail Connection: the Gmail Web Connection name you just setup

 Emailer

Click OK
 
Before running the workspace to test this, replace the fake crew chief email address in the crewcheifs.csv file with your own email address for the damage type you entered in your Field Maps test record. Run the workspace and check your email in a minute or two for the notification email.
Sample Email

4. Clean up the Workspace
 
Let’s clean up attributes before writing out to the database. Add another AttributeManager and connect it to the Emailer. Remove and Rename fields as follows:

  • Formatted_Date: remove (this was only needed for the email)
  • crew chief: Assignee
  • email: Assignee_Email
  • department: Department
  • damage type: remove

AttributeManager
 
Note: SpatiaLite doesn’t have a datetime datatype. It supports storing Epoch Dates as integers, which is the format of the Reported_On field, so we can write it to the database. It is also helpful to store it this way if we need to read from our database and write back to ArcGIS Online, since it will expect an Epoch Date.

Add a bookmark around the transformers from the FeatureJoiner to the AttributeManger_2 and name it “Notify crew chief”.
Workspace
 
5. Write to Spatialite Work Order Database
 
All we have left to do now in this workspace is write the record to the SpatiaLite Work Order Database. So that the crew chief can take further action, reassign the work and eventually close the work order. In the real world, this would likely be a different system, like a solution from a different vendor, with much more detail.
 
Add a new writer to the canvas. Choose SpatiaLite as the Format, provide an output destination, name the database "WorkOrders," and set the Table Definition to Automatic. Leave the coordinate system as Same as source. Click OK.
Add SpatialLite Writer
 
In the writer feature type parameters, name the table "Work_Orders." Choose db_point as the Geometry. Ensure that the Feature Operation is set to Insert and Table Handling to Create If Needed. Click OK
Writer Feature Type
 
Note that a new published parameter was automatically generated named "DestDataset_SpatiaLite". This will be used in our Automation to set the output destination in the FME Server shared resources.
 
Connect the AttributeManager_2 to the SpatiaLite writer, and run the workspace. View the output data to verify that it was written as expected.
Workspace with Output
Map tiles by Stamen Design, under CC-BY-3.0. Data by OpenStreetMap, under CC-BY-SA.
 
You can test the workspace by submitting additional records from the Field Maps app and copying the response payload from the FME Server log into the feature parameter, like we did in Part 3, Step 1. You can set the writer’s Overwrite Existing Database parameter to Yes while you test (as shown below), but make sure to set it back to No prior to publishing to FME Server.
Overwrite Existing Database
 
6. Publish to FME Server
 
Now that our workspace is complete, we need to publish the workspace, csv file, and SpatiaLite database to FME Server. If this is your first time doing this, please read our article on publishing workspaces to FME Server before proceeding. It is a good idea to save your workspace before publishing. 
 
Before publishing this, let’s embed the ArcGISOnlineWebhookDataGetter, since it is a custom transformer. To learn more about working with custom transformers in FME Server, please read Custom Transformers and FME Server
 
Right-click on the ArcGISOnlineWebhookDataGetter and choose embed
Embed Transformer
 
The transformer will turn green, indicating that it has been embedded. 
 
You may also want to replace the other fake email addresses in the crewchiefs.csv file with your own email for testing purposes.
 
In FME Workbench, click Publish to connect to your FME Server. 
 
Choose a repository to upload the workspace to (or create a new repository). 
 
We also want to upload the SpatiaLite database and crewchiefs file. Click Select Files and then Add Files. Navigate to your SpatiaLite database and crewchiefs csv file and select them. Then click Select Location. Choose to upload to a shared resource folder. Creating a new folder within Data on FME Server is advisable. Click OK and Next.
Publish to FME Server
 
In the next window, select both your ArcGIS Online and Google Gmail web connections to upload them to FME Server.
Publish Connections
 
Click Next again and upload the Emailer package. 
 
For services, select Job Submitter and click Publish. Check the Translation Log to make sure everything was published to FME Server successfully.
 

Part 5: Complete the Automation 

With our workspace and files in FME Server, now we can add them to our Automation.
 
1. Authorize the ArcGIS Online Web Connection

First things first, the ArcGIS Online web connection that was uploaded when the workspace was published needs to be authorized. 
In FME Server, click Web Connections under Files & Connections. From the list of web connections, click the name of your ArcGIS Online web connection.
Web Connections

Click Authorize and allow the request for permission from Esri when prompted. Once authorized, you should see a green check mark beside the connection name.
Authorize Connection on FME Server

Note: if you are using an existing ArcGIS Web Connection on your FME Server and are unable to authorize your connection, please see the FME Server section of this ArcGIS Online Web Connection Error article. 
 
The Google Gmail web connection does not need to be authorized.
 
2. Create a Workspace Action
 
In FME Server, go back to your Field Maps Automation. Stop the Automation if it is still running.
 
Connect the Log Action to the Webhook Trigger’s Action Failed Port, instead of the Action Succeeded port. Add a new Action to the canvas and connect the Webhook Trigger’s Action Succeeded port to it. 
Connect Workspace in Automation
 
Open the Action and set it to Run a workspace. Choose the repository where your StormDamage.fmw workspace was published. You will notice that the Webhook Message field is already filled in. This is the test payload that we used in our workspace’s user parameter default value, but we want the message content instead. Open the drop-down menu, expand the Webhook Keys, and select message content.
 
For the SpatiaLite Database parameter, click the ellipses and navigate to the database file that you uploaded to FME Server. Select it, click OK. The crewchiefs.csv file should already have the correct path, but if not, you may need to do the same for it. Click Apply.
Configure Workspace Action
 
Your ArcGIS Online Field Maps webhook Automation is complete and ready to receive submissions! With this setup, you will automatically be sending a notification to the responsible party and updating the Work Orders database whenever a form is submitted, which saves time and effort and streamlines the process. While this workflow writes to a database file that needs to be downloaded to view, you can write to an external database such as PostGIS or SQL Server, or use FME to connect to a different system, instead.
 
This Automation is relatively simple; we only write new features to the database. It could be expanded by updating the database when a feature is updated in Field Maps or deleting records when they are deleted. The ArcGISOnlineWebhookDataGetter returns these events as well.
 
Note: Remember to remove the test records from your database and ArcGIS Online feature service before you deploy the Automation! 
 

Additional Resources

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.