Select to view content in your preferred language

When record is updated Trigger not working

207
9
a week ago
KevinDohner
Occasional Contributor

I am trying to setup a flow so that when I change the status on a survey123 from "Needs Updates" to "Completed" it will send a notification email. I am using the "When record is updated in feature layer" trigger for ArcGIS Enterprise and have it pointing to the feature layer for the survey123 but when changing the attribute, the flow never triggers.

I have tried editing the layer in the "Data" tab in Survey123 as well as a web map but nothing happens in the flow. I have also tried changing the layer the trigger is pointed to to the source hosted feature layer as well as the 2 views (1 for the form and 1 for the results) and still nothing happens.

We have a different flow that is setup for "When a survey response is submitted" and that works fine with this survey.

Also to note, I actually can't get the "When record is updated in feature layer" trigger to work for any layer I have tried it on. So the problem could just be I am not understanding how to use that trigger.

0 Kudos
9 Replies
gis_KIWI4
Frequent Contributor

@KevinDohner - The first thing to check is to see if a webhook has been created.
If you set up the flow in PowerAUtomate, check the survey123 settings.
gis_KIWI4_0-1758764306743.png

The webhook is critical for the triggers to work.
If the webhook does exist, it's worth checking within the webhook to see if trigger options are set up correctly. 

gis_KIWI4_1-1758764438614.png

 



Are you using AGOL or Enterprise?




0 Kudos
KevinDohner
Occasional Contributor

A webhook is not being created when using that trigger. If I switch it to the "When a survey response is submitted" trigger, a webhook gets created, but I assume I wouldn't be able to fetch updates based on that trigger and if I remove that trigger the webhook will also get removed.

0 Kudos
gis_KIWI4
Frequent Contributor

You can use the "survey is submitted" connector but in the webhook settings (within survey123) you can just have the webhook trigger on "Existing record edited" and leave the "New record submitted" ticked off. 

The flow will only trigger when a record is edited and not when it's submitted for the first time. 

gis_KIWI4_0-1758832434065.png

 

0 Kudos
KevinDohner
Occasional Contributor

I will definitely take a look at this. If I understand you correctly, I would still use the "When a survey is submitted" trigger, but since the webhook for that trigger is set to existing record edited, it will actually trigger the flow when something is edited?

gis_KIWI4
Frequent Contributor

Yup, that is the idea. Also make sure you use the newer ArcGIS connectors(yellow) rather than the Survey123 connectors (green coloured)

0 Kudos
KevinDohner
Occasional Contributor

I did that, but still nothing. When I had the webhook only trigger when an existing record is edited, it never triggered the flow. I then turned on the submitted trigger in the webhook and added a submission, and it worked immediately. I am stumped as to why the edit trigger doesn't activate.

I am using Enterprise if that makes a difference, so I am using the Enterprise connector (purple).

0 Kudos
gis_KIWI4
Frequent Contributor

@KevinDohner - Try what Akshay has suggested but I think that still doesn't explain the submitted vs edited conundrum.

Just to clarify -
If you add the "when a survey response is submitted" trigger, you will be able to see the webhook in the Survey123 page. 


If you use a feature level trigger like "When a record is created/updated in a feature layer" you will NOT see in the Survey123 settings page. You will need to check it in the REST endpoint of the feature layer. 
Edit - Use the Admin option to see the webhooks option

gis_KIWI4_1-1759348729997.png

gis_KIWI4_2-1759348809718.png

 

In that section you can check to see if webhook is created for "When records are updated"
You will also be able to see if the webhook is trigger okay (or the errors) under the notification status.

One thing that is stumping me is - why does it work when "record is submitted in a feature layer" but not for updated.


https://learn.microsoft.com/en-us/connectors/arcgis/#when-a-record-is-created-in-a-feature-layer:~:t...

Can you share some pictures of the flow maybe?
Also share some details about the FL - is it a setup where you are using related records? Could it be that the changes are not being registered as "Updates" 

 

 

 

AkshayHarshe
Esri Contributor

@KevinDohner 

If you are using `When a record is updated in the feature layer ` trigger then you will need to follow that with `Fetch updates, changes, deletions...` action. There can be several reasons for webhooks to not work. See if you have following: 

To create webhooks you must

  • Own a feature layer
  • Has editing enabled
  • has editor tracking enable `Keep record of changes, updates ...`
  • If admin has disabled the webhooks they must be enabled. 
  • and your user type should also have ability to use the webhooks.

Check all the pre-requisites here Create webhooks—Portal for ArcGIS | Documentation for ArcGIS Enterprise

Follow this guide to troubleshoot webhooks: Guide: Troubleshooting ArcGIS and ArcGIS Enterpris... - Esri Community

Thanks,
Akshay Harshe
0 Kudos
gis_KIWI4
Frequent Contributor

Also going to leave this here if it might help with some troubleshooting. 

https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/guide-troubleshooting-a...

 

0 Kudos