Select to view content in your preferred language

Hosted feature layer webhook not triggering when edits are made to view layer

170
4
a month ago
MichaelTorbett
Frequent Contributor

I am using Power Automate and the feature service webhook "When a record is updated in a feature layer" to trigger an email when updates are made. However, updates will be made through a feature layer view, which does not seem to be triggering the webhook. I can only get the webhook to trigger if edits are made directly from the hosted feature service.

Is this expected behavior?

Thanks,

Michael

0 Kudos
4 Replies
ChristopherCounsell
MVP Regular Contributor

We had the same scenario:

  • Hosted Feature Layer (with webhook)
  • Hosted Feature Layer View (where edit is made).

I can confirm that the edit on the View would trigger the webhook on the underlying service. There was no webhook on the view itself. It might be that you need change tracking enabled on the View item editing settings?

ChristopherCounsell_0-1734417089443.png

However I would not recommend doing this. As every edit made seems to trigger the webhook, which caused issues doing administrative editing tasks (or if the webhook triggers an edit on the same service, it creates a loop). I've had to adjust the above scenario to the view having the webhook, not the source feature service.

I would instead recommend:

  • Never sharing the original feature service nor setting up webhooks on it. This is optimal for data security.
  • Create a view, and webhooks on the view itself to trigger when an edit is made against the view.

This way you can better control access to the data and where the edits (e.g. field staff) should trigger the webhook.

If you must have absolutely any edit trigger the event, enable change tracking on your view layers and configure the web hook on the underlying feature service, but I'd still recommend not sharing the original feature service.

MichaelTorbett
Frequent Contributor

Christopher,

Thank you for the reply and confirming that the webhook will trigger if edits are made on the view.  I had originally setup the webhook against the view, but it would not trigger. Yesterday, I did notice that the track changes box was not checked on the view, but even when I turned it on, nothing happened. I'm going to try it again this morning and see if it will work. I will put the webhook back on the view since you confirmed that it does work. 

I will give an update shortly.

Thanks again!

Michael

0 Kudos
ChristopherCounsell
MVP Regular Contributor

Make sure the webhook is activated and setup for all desired editing modes as well.

0 Kudos
MichaelTorbett
Frequent Contributor

Well..the webhook never would trigger against the view and it would only intermittently trigger against the hosted service. My tech support analyst thinks it's related to a bug (see below). However, that doesn't explain why it will not trigger at all against the view. I think for now, going to have to do a mail merge and then revisit this sometime after Christmas. 

bug-000168340