TransWikia.com

AGOL webhook to Integromat/Google Sheets

Geographic Information Systems Asked on February 28, 2021

I have a feature layer in AGOL.

Whenever edits are made to features in the layer, I want to POST those edits/attributes to an external system for testing purposes.

  • In this case, the external system is Integromat (that points to a Google Sheet).

How can I set up an AGOL webhook and point it toward Integromat/Google Sheets?


Related:

Create a hosted feature service webhook

2 Answers

Here's the full Integromat solution:


enter image description here


This JSON can be imported into Integromat to create the scenario (file download): https://drive.google.com/file/d/14AXG9-zK2eGxBxHiWK9lFqoyHfswbdQ8/view?usp=sharing

enter image description here


Note:

A couple of the HTTP request steps would work sometimes, and fail other times.

It seemed to be necessary to give those steps adequate time to process before I sent a subsequent request. I used sleep modules in Integromat to add a slight delay (1-second).

Correct answer by User1973 on February 28, 2021

This solution gets us part of the way there:

When features are edited in the feature layer, an AGOL webhook sends a POST request to Integromat/Google sheets.

enter image description here

However, the result is just information about the edit—it does not contain any of the attributes from the edited feature.



Here are the steps:

AGOL:

  1. AGOL --> Content: Click your feature layer and then go to the Settings tab.
  2. In the Feature Layer (hosted) --> Editing section, ensure that Keep track of created and updated features. is checked.
  3. Click Save.
  4. Go back to the Overview tab (in Content) and click the Feature Service link (in Details --> Source: Feature Service).
  5. In the URL of that FeatureServer page, type /admin between /rest/services/ like so: /rest/admin/services/. Hit Enter.
  6. Click the webhooks link at the bottom of the page.
  7. Click the Create hyperlink.
  8. You should be able to see the webhook page:

enter image description here



Integromat:

We'll use Integromat and Google Sheets as an external system to POST to:

  1. Create an Integromat account.
  2. Click Scenarios in the left pane.
  3. Click Create a new scenario in the top right corner.
  4. Search for "webhooks".
  5. Select the webhooks module and then click Continue in the top right corner.
  6. Click webhooks:

enter image description here

  1. Click Custom webhook.
  2. Click Add and give your webhook a name.
  3. Click Save.
  4. A URL is generated. Click Copy address to clipboard:

enter image description here



AGOL:

  1. Paste in the URL to the AGOL webhook:

enter image description here

  1. Click Create.
  2. The following webhook is created:

enter image description here

  1. Go to a map in Web Map Viewer (or whatever you use to edit features) and make an edit to a feature.


Integromat:

  1. We can see that the AGOL webhook successfully sent the request to Integromat:

enter image description here

  1. Exit out of the webhooks dialog.
  2. We'll configure the webhook so that it captures the data in a Google Sheet:

enter image description here

  1. Click Add a row.
  2. Create a connection to your Gmail account.
  3. Select the Google Drive spreadsheet that you want the data to go into.

enter image description here

  1. Select payload in the Google Sheet field that you want the webhook data to go into.
  2. Click OK and click the Save button in the bottom toolbar:

enter image description here

  1. Turn it ON and click Activate.

enter image description here



Create a new feature and test:

  1. In AGOL, create a new feature.
  2. The record should show up in the Google sheet (in 30 seconds).

enter image description here

Answered by User1973 on February 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP