Survey123 Webhooks not Triggering when Surveys are Designed to Submit Entries to a AGO Hosted Feature Service's Related Table

2414
5
03-14-2019 01:03 PM
daveostrander
Occasional Contributor II

I am currently having an issue using webhooks with Survey123, where the payload does not appear to be sent at submission time. I am using an existing hosted feature service to create and publish my surveys, each survey is pointed at a separate related table within the feature service (i.e.1 feature class related to 3 different tables using 3 relationship classes at the database level; nothing nested, all tier 1 relationships). I am able to create the surveys without issue, publish them with no problem, and add records to related tables using Survey123, again without any trouble. I can see the data on the Survey123 website as it gets submitted, both in the table on the data tab, and in the action tab that comes up when you select the record in the table. However, the webhooks do not appear to ever be triggered when the survey is submitted, which is evidenced by not seeing any sort of failure or success messages within Integromat or Microsoft Flow. 

In contrast to the previous workflow, I have another hosted feature service that only contains a single related table. When I create/publish this survey in the exact same way as outlined above I am able to make use of the webhook without any issue. To be clear, all of the feature services mentioned in this post are hosted on ArcGIS Online, use non-versioned data, rely on GlobalIDs for the primary and foreign keys, have the foreign key's GUID fields added to the surveys with the XLSForm's field type set to esriFieldTypeGUID, and have the form_id set to the name of the corresponding related table. The only difference across both implementations, is that one feature service has multiple related tables, while the one that functions contains a single related table.

It is vitally important to have the previously described workflow (i.e. relationships like FS1 > FSRelatedTable1, FS1 > FSRelatedTable2, FS1 > FSRelatedTable3), since each of the three survey types record very different data, contain a varying quantity of fields, and require that the payload data be converted into 3 very different PDFs, which then get emailed as attachments within our Integromat workflow. I have contemplated workarounds, but I am not interested in having multiple feature services for each type of survey, since the data being collected, while quite different at the table level, is very much aligned at the feature class level.

This part of the project is the last piece of the puzzle (all other systems are a go), but without a functional webhooks component the whole project essentially collapses. Please help!

0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Dave,

The webhooks shouldn't have any dependency on your table structure - they are completely independent of that.  A couple of things to check:

- In the Form's Settings page on the Survey123 website, do you see the MS Flow webhook entry?

- Did you download the form before the webhooks are created?  If so, you should re-download the form

- You are not using the Inbox to open up the existing feature and add inspection records?  This is actually an edit event, which we do not yet support webhooks being triggered on yet.

0 Kudos
daveostrander
Occasional Contributor II

Hi James,

Thanks for replying so quickly! I did look into the advice you provided:

James Tedrick wrote:

- In the Form's Settings page on the Survey123 website, do you see the MS Flow webhook entry?  Yes, webhooks appear and use the correct urls.

- Did you download the form before the webhooks are created?  If so, you should re-download the form. Made sure to delete existing survey and re-download latest form.

- You are not using the Inbox to open up the existing feature and add inspection records?  This is actually an edit event, which we do not yet support webhooks being triggered on yet. I am not using the inbox, and sending the surveys at submission time.

In reviewing things a little further I discovered that the web app version of Survey123 does trigger the webhook, sends the payload, and is received successfully by Integromat using my preferred data structure (FS1 > FSRelatedTable1, FS1 > FSRelatedTable2, FS1 > FSRelatedTable3).

It seems that the issue lies in using the Survey123 field app. I have saved the internet posts/responses (saz files) using Fiddler, which I ran while testing:

  1. Survey123 web app against my more complex feature service (FS1 > FSRelatedTable1, FS1 > FSRelatedTable2, FS1 > FSRelatedTable3). This worked!
  2. Survey123 field app against my more complex feature service (FS1 > FSRelatedTable1, FS1 > FSRelatedTable2, FS1 > FSRelatedTable3). This failed!
  3. Survey123 field app against my simple feature service (FS2 > FS2RelatedTable1). This worked!

I would be happy to share those saz files with you if you would like to review the http traffic recorded at survey submission time. Oddly enough, the field app test that failed did indicate that Integromat appears to accept the payload, but doesn't appear to first establish a connection with Integromat. In contrast, all of the other testing above that proved successful, Fiddler first logged a connection with Integromat first. In the failed test we seem to be missing the tunnel to Integromat.

It is nice that at least there might be a way forward using the Survey123 web app, but for various reasons it would definitely be preferred to always run the Survey123 collection directly from the field app. Any thoughts?

0 Kudos
PeipeiLin1
New Contributor II

When will the edit event - adding data through inbox be supported?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Peipei,

Support for edit events in Webhooks was introduced in Survey123 3.5 (June 2019).  Are you not seeing that setting?

0 Kudos
PeipeiLin1
New Contributor II

I checked editData as trigger event in Integromat, which is also the case in Survey123 Webhooks setting.  However, the Survey123 Webhooks is not triggered when submitting survey from Inbox even with the edit events enabled.

--------

SOLVED.

The edit events works after I switched the web app version to match the publish version in the Survey123 setting . 

0 Kudos