Select to view content in your preferred language

How to avoid infinite recursion when using a webhook to update a layer

148
1
Jump to solution
Tuesday
MatthewBertrand
Occasional Contributor

Hello everyone,

I am trying to use a Make scenario to make updates to a Hosted Feature Layer that has a webhook in operation. I am stuck dealing with an issue with infinite recursion--if Make changes the layer with the webhook, then the webhook gets triggered again, which causes Make to update the layer, which triggers the webhook...

My first attempt at a solution was to make a new view layer with no webhook, but unfortunately the webhook is still getting triggered. Per a separate community conversation, it sounds like this approach might work with Power Automate, but doesn't seem to be working with Make. More details on my set-up below.

Has anyone resolved a situation like this?

LAYERS

  1. Hosted feature layer, no webhook. Edits here trigger the webhook.
  2. Edit view on the hosted feature layer, has the webhook. As expected, edits here trigger the webhook
  3. Created a new view on the hosted feature layer for Make to edit, no webhook. Set editing to allowed, but turned off change tracking. Edits here trigger the webhook.

Am I missing a way to avoid triggering the webhook on the view layer?

 

Matthew Bertrand
Park Planner
Washtenaw County Parks and Recreation
1 Solution

Accepted Solutions
MatthewBertrand
Occasional Contributor

Found a solution. I've now got the Make scenario filtering out any webhook changes that originate from Make.

The challenge at first was finding a filter variable that was distinct from user generated webhook triggers vs Make generated webhook triggers. In our setup, the Editor variable is different. Our Make editor is an administrator account that would never trigger user generated changes to the hosted feature layer. So now user generated webhook triggers complete the planned scenario operations--including edits to the layer that trigger an additional webhook call. But the subsequent Make-triggered webhook does not perform any significant operations, crucially including no further changes to the layer to avoid triggering an infinite loop of webhook calls.

Matthew Bertrand
Park Planner
Washtenaw County Parks and Recreation

View solution in original post

1 Reply
MatthewBertrand
Occasional Contributor

Found a solution. I've now got the Make scenario filtering out any webhook changes that originate from Make.

The challenge at first was finding a filter variable that was distinct from user generated webhook triggers vs Make generated webhook triggers. In our setup, the Editor variable is different. Our Make editor is an administrator account that would never trigger user generated changes to the hosted feature layer. So now user generated webhook triggers complete the planned scenario operations--including edits to the layer that trigger an additional webhook call. But the subsequent Make-triggered webhook does not perform any significant operations, crucially including no further changes to the layer to avoid triggering an infinite loop of webhook calls.

Matthew Bertrand
Park Planner
Washtenaw County Parks and Recreation