Editing Existing Data Email

1426
5
Jump to solution
02-05-2021 12:49 PM
JasonSimpson
New Contributor III

I have a flow set up in Power Automate set to run when a new survey is submitted. With the exception of figuring out how to attach images from the newer multiline image feature, the flow works great. What I am trying to understand is how to send an email notification when a survey is edited. I have gone to the arcgis online webhook page and enabled the options for when a survey is submitted and when a survey is edited, but that does not seem to to help. This is important because we are tracking a site via a repeat section, so I need to send an email anytime a repeat item is added.  Any help would be appreciated. Thanks. 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @JasonSimpson

Since "New record submitted" and "Existing record edited" are enabled for the Trigger events the webhook should trigger automatically whether a new survey is submitted or an existing record is edited. 

I had tested on my end with a public survey in Chrome set to trigger a webhook when a new record is submitted and when a record is updated and I am not seeing the same behavior. 

What version of Survey123 is the survey using? Is there any difference between submitting as a public user vs a user who is logged in? Are there any differences between browsers? 

If you open the f12 developer tools in a browser where the behavior is occurring specifically the network panel and submit an edit you should see a request to the payload URL shown on the Webhooks page for the survey. Are you seeing a request submitted to the payload URL when editing a record? 

Thank you,
Zach

View solution in original post

0 Kudos
5 Replies
ZacharySutherby
Esri Regular Contributor

Hello @JasonSimpson

Is your survey shared publicly, and being edited using the Webform in Internet Explorer or Edge? 

We have a BUG (BUG-000134259) where surveys edited in that environment are not sending the update trigger for the webhook. 

Thank you, 

Zach

Thank you,
Zach
0 Kudos
JasonSimpson
New Contributor III

Yes it is public and I am editing the survey via Chrome. I am curious if I need to create an expression in Power Automate for when a repeat is added or if the trigger should automatically run whether I am creating a new survey or editing an existing survey. 

0 Kudos
ZacharySutherby
Esri Regular Contributor

Hello @JasonSimpson

Since "New record submitted" and "Existing record edited" are enabled for the Trigger events the webhook should trigger automatically whether a new survey is submitted or an existing record is edited. 

I had tested on my end with a public survey in Chrome set to trigger a webhook when a new record is submitted and when a record is updated and I am not seeing the same behavior. 

What version of Survey123 is the survey using? Is there any difference between submitting as a public user vs a user who is logged in? Are there any differences between browsers? 

If you open the f12 developer tools in a browser where the behavior is occurring specifically the network panel and submit an edit you should see a request to the payload URL shown on the Webhooks page for the survey. Are you seeing a request submitted to the payload URL when editing a record? 

Thank you,
Zach
0 Kudos
JasonSimpson
New Contributor III

@ZacharySutherby 

I am using version 3.11.164 and survey connect version 3.11.123. I am actually logged in as a user when submitting the survey. 

When recording network activity, I notice the web hook has a status of 404. The information or that line is below. 

JasonSimpson_0-1612877209793.png

JasonSimpson_1-1612877333618.png

JasonSimpson_2-1612877427782.png

JasonSimpson_3-1612877483340.png

Also enclosed is an attachment showing the error log. 

 

 

 

0 Kudos
JasonSimpson
New Contributor III

Just as an experiment, I created a simple form with one repeat, tested it and the flow triggers when I edit the form. My original form has three different repeat sections with their relevance tied to an answer further up the page, so now I will try to add the remaining repeats to see if I can edit those as well.  I have to be honest, automating this process via power automate with repeat data has been quite a pain. 

On a side note, can you guide me to any documentation that would help me pull only the newest repeat item for an email? I have an inspection form with with each repeat item within a repeat being a new inspection. I am looking to send an email notification to project managers once an inspection by our field crew is finished. 

0 Kudos