Configure layer in ArcGIS Enterprise to allow editing
To begin, you must enable the feature layer to allow editing. If the layer does not have these options enabled, the webhook and updates will not work.
- Log into your ArcGIS Enterprise portal
- Navigate to the location of your feature layer and select it
- Select the layer that you want to enable editing on
- Click Settings from the ribbon
- Scroll down to the Feature layer (hosted) section and enable the following options under Editing:
- Enable editing
- Keep track of changes to the data
- Under the What kind of editing is allowed section, enable the options applicable to your flow
- The settings will save automatically
Configure trigger (automated cloud flow) in Power Automate
Next, we need to configure the trigger in Power Automate to obtain the HTTP POST URL. In these steps, a flow will be configured to listen for changes to the feature layer.
- Create a new automated flow
- Name your flow and then select Skip
- The following trigger is not in the auto-generated list when creating a flow
- In the Flow editor, search for the following trigger and select it:
- When an HTTP request is received
- In the Request Body JSON Schema, paste the following JSON into the field:
{
"type": "object",
"properties": {
"serviceType": {
"type": "string"
},
"changesUrl": {
"type": "string"
},
"name": {
"type": "string"
},
"id": {
"type": "string"
},
"folderName": {
"type": "string"
},
"serviceName": {
"type": "string"
},
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"eventType": {
"type": "string"
},
"when": {
"type": "integer"
}
},
"required": [
"eventType",
"when"
]
}
}
}
}
- Add a new action and search for the ArcGIS Enterprise connector
- Under the list of actions, select Fetch updates, changes, or deletions from feature layer (Preview)
- In the Get changes from field, select the chnagesUrl from the dynamic content list
- Select the layer that is needed for the webhook flow. This should be the same layer you edited in the first section of this walkthrough.
- By default, all the options that can be used as trigger are set to true. You can change these options based on the type of flow you are creating.
- Save the flow. After saving, the trigger will autogenerate a URL. This URL is needed for the next steps and configuring the webhook in ArcGIS Enterprise.
- After saving, you should have a flow that looks like this:
- Keep this tab open as the HTTP POST URL will be needed for configuration steps in the Enterprise organization
Configure feature layer with webhook URL
This section will go over the steps necessary to create a webhook on the feature layer you are using for your flow.
Prerequisite: You must be signed in as an administrator on the Enterprise organization to process the next steps.
- Navigate to the following URL:
- https://organization.domain.com/server/admin/login
- When the page loads, you should see the following screen:
- In a new tab, open the following page:
- https://organization.domain.com/portal/sharing/rest/generateToken
- The following page appears:
- Type in the administrator’s username and password
- Under the Client section, ensure that Wepapp URL is selected and type in the following URL format:
- https://organization.domain.com:443/server/admin
- Set the expiration to any of the options in the dropdown. The default is one hour.
- Once all the fields are filled in, press Generate Token
- Copy the Generated Token from the new field that appears
- On the previous page/tab, paste in the newly generated token to the Portal token field
- Press Login
- Once logged in, select Services from the list of resources
- Select the appropriate folder where the feature layer is stored. By default, this should be under the Hosted category
- Select the service you want to add the webhook to
- When the new page loads, scroll to the bottom of the page
- Select webhooks
- From the Supported Operations section, select create
- On the Create Webhook page, fill in the appropriate information to create the webhook
- Name: Name the webhook. It is recommended to name this something meaningful to keep track of the webhooks
- Changes type: By default, a “*” (wildcard) should be entered to retrieve all the changes on the layer. You can specify which changes you’d like if you do not want to capture every action made against the layer.
-
- HookURL: This is the URL that was generated from the Power Automate automated flow. Paste the value from the trigger into this field.
- After pasting the URL, click Create
- The webhook has been successfully created
Create a flow to test the webhook on the feature layer
Now that the webhook has been created, we can run a simple test to see if the webhook is listening and capturing changes as expected. A simple test for this is to add a new attachment to a feature layer.
- Create a new Instant Cloud flow from your Power Automate landing page
- You can name the new action; however, it is not necessary. This action is meant as a test to see if the webhook is working and can be deleted after the test.
- Add a new step and search for the ArcGIS Enterprise connector
- Select Add attachment from the list of actions
- In the action window, select the layer that contains the webhook
- For Record ID, type in an ObjectID or unique identifier from your feature layer. You may need to show this column in your data table
- For Attachment name, type in:
- webhooktest.txt
- For File content, type in:
- This is a test.
- Save and test the flow
- After the flow runs, the Run History should show that it succeeded
- Open the Webhook flow to see if the webhook was trigger correctly
- The Run History should also show a new entry and the webhook process should be successful