English

How To: Create an ArcGIS Survey123 connector for Microsoft Power Automate for use with ArcGIS Enterprise

Summary

ArcGIS Survey123 supports webhooks, which allow integrating surveys into automated workflows using various third-party automation services. See the ArcGIS Survey123 web help topic: Webhooks. One such service is Microsoft Power Automate, which has a built-in Survey123 connector for surveys published to ArcGIS Online.

Note:
Due to limitations in the Power Automate platform, this connector does not support surveys published to ArcGIS Enterprise.

To use Power Automate with surveys published to ArcGIS Enterprise, it is necessary to create a custom connector in Power Automate.

Procedure

Note:
Configuring a Survey123 connector for Microsoft Power Automate is not supported for ArcGIS Enterprise deployments that use Integrated Windows Authentication (IWA). Additionally, since Power Automate must communicate with your ArcGIS organization, deployments that are not public-facing are not supported. 

Step 1: Register an application in ArcGIS Enterprise for Power Automate

Microsoft Power Automate must be registered as an application in ArcGIS Enterprise so that it can access the list of survey forms and apply webhook settings to surveys. During the registration process a client ID and client secret are created; you will need these to create the custom connector.

  1. Sign in to your ArcGIS Enterprise instance and go to the My Content tab. Click Add Item and select An application. In the Add an application dialog box, provide the following input:
    • Type: Application
    • Title: Power Automate Connector
    • Tags: power automate
the Add an application dialog box with selected options
  1. When the item is created, the Item Details page displays for the application. Go to Settings. In the Application section, click Registered Info and Show Secret. Copy the App ID and App Secret; these are used in the steps below. Keep this tab open; the redirectURI must be updated as well.

Step 2: Create a custom connector in Power Automate using the Survey123 website

  1. In a new tab, sign in to Microsoft Power Automate. In the left sidebar, select Data and Custom connectors.
  2. Click the New custom connector drop-down at the top right and select Import an OpenAPI from URL.
New custom connector options drop-down
  1. In the Import an OpenAPI from URL dialog box, complete the following:

    In the example below, <ENTERPRISE_URL> is the URL to your ArcGIS Enterprise deployment, including the web adaptor, for example, https://myserver.mycompany.com/arcgis.

    https://survey123.arcgis.com/api/template/swagger?portalUrl=<ENTERPRISE_URL> 
    1. Connector Name: ArcGIS Enterprise Connector (this can be whatever you want to call it).
    2. Paste in the URL for the Open API, and click Import.
    3. After the API has been imported, click Continue.
OpenAPI from URL dialog box
  1. Configure the general properties of the connector, including the icon and description. The Host entry is the location of the Survey123 functions (survey123.arcgis.com, in this case) that will be used by the connector. Click the Security > link below to proceed to the next section.
  2. The Security section is preconfigured to use OAuth 2.0, and the authorization and token endpoints for the ArcGIS Enterprise deployment.
    1. Copy the App ID from the application registered in ArcGIS Enterprise into the Client id setting.
    2. Copy the App Secret from the application registered in ArcGIS Enterprise into the Client secret setting.
    3. Copy the URL in Token URL into the Refresh URL setting. ArcGIS Enterprise uses the same API location for initial token generation and token refresh.
    4. Click Create connector.
  1. After the connector is created, the bottom of the security settings has an entry present in the Redirect URL setting. Copy that value. In the ArcGIS Enterprise application settings page, select Update. Add the URL to the list of redirect URIs and click Update.
    ArcGIS Enterprise application settings page
  2. Return to the Power Automate tab. Click the 4. Test link at the top. Create a new connection - you should be prompted to sign in to ArcGIS Enterprise in a pop-up window. Once a connection has been created, you can test the webhook functions:
    • GetOwnedSurveysList - Returns a list of your surveys. Select a survey and copy its id for use in subsequent steps.
    • Get WebhookPayload - Returns a payload definition that can be used by Power Automate to automatically present values like the feature's fields in other steps of a flow. Requires a survey id.
    • AddData (NOTE: this is out of order from the screen) - Registers a webhook with a form. Requires a survey id and destination URL (can be a test URL like https://localhost). The events that will trigger the webhook (addData|editData|addData,editData) also need to be specified. The results contain a unique id that will be used in the RemoveWebhook step.
    • RemoveWebhook (NOTE: this is out of order from the screen) - Removes a given webhook from the form. Requires a survey id and webhook id from the AddData step.
Power Automate tab webhook test functions

If all operations pass, the connector can be used in Power Automate. When creating a new flow, skip the Choose your flow's trigger in the initial screen and select from your custom connectors in the main flow editing screen.

Last Published: 2/26/2021

Article ID: 000025025

Software: ArcGIS Survey123 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.11, 3.10, 3.1, 3.0, 2.9.Classic, 2.8