Automate Field Maps

You can automate ArcGIS Field Maps to streamline how you prepare maps and deploy them to the field. You can use webhooks and scripting to automate a variety of tasks, such as copying a form between maps and automatically generating an email notification whenever an asset is inspected. The following are two ways you can automate tasks for Field Maps:

  • Set up a webhook in Integromat—Automatically receive notifications in near real time when mobile workers create, edit, or delete features in the field.
  • Use ArcGIS API for Python—Use Python scripts and notebooks to configure and deploy maps and manage and analyze data collected in Field Maps.

Set up a webhook in Integromat

A webhook allows an application to provide other applications with event-driven information. Common uses for webhooks include sending notifications via email or SMS, posting messages to social media, automatically writing records to a spreadsheet, and updating enterprise databases. Field Maps supports webhooks through Integromat, a third-party workflow automation service. Integromat has a built-in Field Maps app that allows you to integrate Field Maps into a webhook workflow. You can integrate the Field Maps app in the following ways:

  • Trigger a webhook—The Watch Features trigger watches for features that are added, edited, or deleted in the Field Maps mobile app.
  • Make an API Call—The Make an API Call action allows you to make API requests to ArcGIS web services.
Note:

The Field Maps app in Integromat only supports hosted feature services and is not currently supported on ArcGIS Enterprise.

Add the Field Maps app

To add the Field Maps app to a webhook in Integromat, complete the following steps:

  1. Browse to https://www.integromat.com/ and sign in.

    If you don't have an account, sign up for free to get started.

  2. Click Create a new scenario.
  3. Search for ArcGIS Field Maps, select it, and click Continue.

    The ArcGIS Field Maps app is listed as a favorite in your scenario.

  4. Click the module button in the middle of the screen and select ArcGIS Field Maps from the menu.

    The ArcGIS Field Maps app is added. You can use the app to trigger a webhook or make an API call to ArcGIS web services.

Connect to your ArcGIS organization

If this is your first time using the Field Maps app in Integromat, set up a connection to your ArcGIS organization. How you connect to your organization depends on which module you use and the services you're accessing.

Connect the Watch Features trigger to your ArcGIS organization

To connect the Watch Features trigger to your ArcGIS organization, complete the following steps:

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Watch Features trigger.
  3. Under Webhook, click Add.
  4. Under Connection, click Add and name the connection ArcGIS.

    To connect to ArcGIS Online, click Continue to sign in to your ArcGIS organization.

You can view and edit the connections you make on the Connections tab in Integromat. To connect to multiple web services in ArcGIS, you may need to create multiple connections. For example, if you use a Make an API Call module to query a feature layer and another Make an API Call module to access the Sharing API, you'll need a separate connection to each service.

Note:

If you don't use a connection for 90 days, the refresh token expires and you must reconnect to your ArcGIS organization. If maxTokenExpirationMinutes is configured for your organization and is less than 90 days, the refresh token expires based on that value.

Connect the Make an API Call action to your ArcGIS organization

To connect the Make an API Call action to your ArcGIS organization, complete the following steps:

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Make an API Call action.
  3. Under Connection, click Add and provide the following:
    1. Connection name—Provide a name for the connection, such as ArcGIS.
      Note:

      If you're accessing the Sharing API, click Continue to sign in to your ArcGIS organization instead of completing the substeps below.

    2. Sub-domain—Specify the services to connect to. For example, if you're connecting to feature services, type services.

      Note:

      If you're connecting to feature services, review the item page of your feature layer for the sub-domain to use. Under URL, the displayed link begins https://<services>.arcgis.com. Use the text in <services> as the sub-domain to connect the module to feature services.

    3. ArcGIS Online URL—Click Show advanced settings and provide the URL to your ArcGIS organization.

      To connect to ArcGIS Online, click Continue to sign in to your ArcGIS organization.

You can view and edit the connections you make on the Connections tab in Integromat. To connect to multiple web services in ArcGIS, you may need to create multiple connections. For example, if you use a Make an API Call module to query a feature layer and another Make an API Call module to access the Sharing API, you'll need a separate connection to each service.

Note:

If you don't use a connection for 90 days, the refresh token expires and you must reconnect to your ArcGIS organization. If maxTokenExpirationMinutes is configured for your organization and is less than 90 days, the refresh token expires based on that value.

Trigger a webhook with the Field Maps app

Webhooks can be set up and activated when a feature is created, updated, or deleted in Field Maps or other applications, such as Map Viewer. For example, after a new feature is collected in Field Maps, a webhook can trigger another action, such as sending an email notification. Complete the following steps in Integromat to create a webhook that sends an email notification every time a feature is created, updated, or deleted in the Field Maps mobile app:

Note:

For a step-by-step tutorial with screenshots, see the Automate email notifications for field updates blog post.

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Watch Features trigger module.

    This module runs the scenario each time a feature is created, updated, or deleted.

    The scenario icon changes color, and a window appears to help you configure the Field Maps module.

  3. Click Add and provide a name for the webhook.
    The name unique to the project or map that will use the webhook.
  4. If this is your first time using this module in Integromat, set up a connection to your ArcGIS organization.
    Note:

    If you created a connection for the Make an API Call module, you can reuse that connection for the Watch Features module.

  5. Under Feature Layer, choose an editable feature layer from your ArcGIS organization to connect to.
  6. Select one or more of the following Trigger events to include in the webhook:
    • Features Created—Triggers the scenario when a feature is created.
    • Features Updated—Triggers the scenario when a feature is updated.
    • Features Deleted—Triggers the scenario when a feature is deleted.
  7. Click Save.
  8. Click OK.

    The Field Maps module is configured.

  9. In the Tools section, click Flow Control.
  10. From the list of options, select Iterator.

    The Iterator module is automatically connected to the Field Maps module. It allows the webhook to iterate over an array of features if multiple features are returned at the same time.

  11. Select the Iterator module and click the Array text box.
  12. From the drop-down menu under ArcGIS Field Maps - Watch Feature Service, find and select one of the following arrays:
    • Adds []—For features being created
    • Updates []—For features being updated
    • Delete IDs [] —For features being deleted
  13. Click OK.
  14. Click the Add another module button next to the Iterator module.
  15. Search for an email service to use, such as Microsoft 365 Email, and select the app.
  16. Select the Create and Send a Message action.
  17. If this is your first time using the module in Integromat, click Add to set up a connection to your email account. Select a connection type and sign in to your account.

    You only need to do this once. Integromat saves the connection for future use.

  18. Add Subject and Body Content text to the email.

    You can use mapping to include attributes from your layer to format the text boxes. If you use mapping, add the layer attributes from the Iterator module.

  19. Add a recipient email address.

    This is the email address where the triggered email will be sent.

  20. Click OK.
  21. Click Save to save your scenario.

    Optionally, click Run once to test the webhook. After clicking Run once, open Field Maps and collect, update, or delete a feature. Confirm that the recipient receives the email.

  22. Use the Scheduling toggle button to activate your scenario. Set the schedule to Immediately to ensure that the scenario runs each time a feature is updated.
Note:

For Integromat support, see the Integromat documentation.

Make an API call with the Field Maps app

The Field Maps app can be used to make API requests to ArcGIS web services. For example, if a user collects a new feature in Field Maps, you can use the Make an API Call module to retrieve that user's email address and send them an email. You can also use the module to query a feature layer and create features, such as a Workforce assignment. The following are examples of how you can use the Field Maps app to make API requests:

Make a request to the Sharing API

The Sharing API allows you to request information about users, groups, and content in an organization. You can use it to look up user information, search maps, view content, and more. You can use the Field Maps app in a webhook to retrieve information from the Sharing API. For example, to send an email to a user who just completed an inspection, you can use the Field Maps app to retrieve their email address. To configure the Field Maps app to retrieve a user's information from the Sharing API, complete the following steps:

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Make an API Call action module.

    The scenario icon changes color, and a window appears to help you configure the Field Maps module.

  3. If this is your first time using this module in Integromat, set up a connection to your ArcGIS organization.
    Note:

    If you created a connection for the Watch Features module, you can reuse that connection to connect to the Sharing API in the Make an API Call module.

  4. Under URL, provide the path to the Sharing API.

    For this example, use the following path to access a user's information:

    /sharing/rest/community/<username>
    For more information, see Introduction to the Sharing API.

  5. Under Method, select GET.
  6. Under Query String, click Add item.
  7. Provide the following inputs:
    1. Keyf
    2. Valuejson
  8. Click OK.
  9. Click Save to save your scenario.

When triggered, the Field Maps module will retrieve the user's information from the Sharing API.

Note:

For Integromat support, see the Integromat documentation.

Make a request to query a feature layer

You can make an API request to query a features layer. For example, you want an end of day summary sent to you via email. You can set up the Field Maps app to query statistics for a day's inspections and include them in an email. To configure the Field Maps app to query a feature layer, complete the following steps:

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Make an API Call action module.

    The scenario icon changes color, and a window appears to help you configure the Field Maps module.

  3. If this is your first time using this module in Integromat, set up a connection to your ArcGIS organization.
  4. Under URL, provide the path to the feature service you want to query:

    /<org-id>/arcgis/rest/services/<layer-name>/FeatureServer/<layer-id>/query

    For more information, see Query (Feature Service/Layer).
  5. Under Method, select GET.
  6. Add the Query String items.
    1. Under Query String, click Add item and provide the following inputs:

      1. Keyf
      2. Valuejson

    2. Click Add.
    3. Click Add item and provide the following inputs:

      1. Keywhere
      2. Value1=1

    4. Click Add.
    5. Click Add item and provide the following inputs:

      1. KeyoutFields
      2. Value*

    6. Click Add.
  7. Click OK.
  8. Click Save to save your scenario.

When triggered, the Field Maps module will query the feature layer based on the parameters you provided.

Note:

For Integromat support, see the Integromat documentation.

Make a request to create a feature

You can make an API request to create a feature. For example, if a fire hydrant inspection is completed in Field Maps, that can trigger the creation of an assignment feature in ArcGIS Workforce. To configure the Field Maps app to add a feature to a layer, complete the following steps:

  1. Add the Field Maps app to a webhook in Integromat.
  2. Select the Make an API Call action module.

    The scenario icon changes color, and a window appears to help you configure the Field Maps module.

  3. If this is your first time using this module in Integromat, set up a connection to your ArcGIS organization.
  4. Under URL, provide the path to the feature service you want to add features to:

    /<org-id>/arcgis/rest/services/<layer-name>/FeatureServer/<layer-id>/applyEdits

    For more information, see Apply Edits (Feature Service/Layer).
  5. Under Method, select POST.
  6. Under Headers, click Edit.
  7. Change Value to application/x-www-form-urlencoded.
  8. Click Save.
  9. Under Body, type f=json&adds=[<json-object>].

    The value for <json-object> must be a JSON string representing a feature. The exact specification to use depends on your layer. For more information, see Feature object.

  10. Click OK.
  11. Click Save to save your scenario.

When triggered, the Field Maps module will add a feature to the layer.

Note:

For Integromat support, see the Integromat documentation.

Use ArcGIS API for Python

Use ArcGIS API for Python to automate and script tasks for Field Maps. You can use the Forms module to author and edit forms used for data collection, and you can access the Field Maps scripts repository on GitHub for example scripts and notebooks. The scripts and notebooks allow you to automate tasks, such as copying forms between maps and downloading attachments from a feature layer.

Note:

To use the Forms module, you must use ArcGIS API for Python 1.9.0 or later.