Select to view content in your preferred language

Power automate ArcGIS Connectors for AGOL Feature layer (hosted, view)

290
6
Jump to solution
3 weeks ago
LouiseG
Emerging Contributor

Hi ESRI Community, I am looking for some documentation or advice on how to use Power Automate ArcGIS Connectors for ArcGIS Online Feature layer (hosted, view) layers. 

We have an editable Hosted Feature Layer, and we are using Power Automate to: 

1) Post a message to a MS Teams named group chat when a new feature is created

2) Post a message to a MS Teams named group chat when a feature is updated

From the Hosted Feature Layer, we have six editable Feature Layer (hosted, view). Edits will be made to these view layers rather than the main Hosted Feature Layer. 

We have created the Power Automate workflows, but they only trigger when the ArcGIS Connectors are pointing to the view layers, rather than the main Hosted Feature Layer. From reading other community posts (e.g. here and here) it seems that Power Automate Connectors need to point to the view layers. 

Would anyone be able to advise me if this is correct? We feel like it's overkill having to enable 'Keep track of changes to the data' on each view layer, and potentially create 12 Power Automate flows. 

Many thanks, 

Louise

 

 

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

What is your trigger for the flow? Anything that isn't on a schedule (e.g., something that runs every x minutes) can result in delays. For example, any time I have a flow with "When an item is updated", it can either trigger instantly, or a minute later. 

And to add on to that, email/email servers can also be slow. I've watch a multi-part approval flow finish to completion, and then 30 seconds later get several emails back-to-back for the different flow steps. Teams would be the same as this.

Personally, I hate the reactive triggers as they never seem to trigger when I expect them to. Also, I find the Survey123 reactive triggers (which I used a lot) very unreliable. Instead, I put everything on a schedule, and if nothing is found the flow is cancelled. I've never had a problem with this, and if an error is encountered, the flow can just reset and try again later. 

I will add that if you go with the schedule approach, you need a dedicated field that can updated by the flow so once something is processed, it isn't reprocessed unintentionally. 

View solution in original post

6 Replies
abureaux
MVP Frequent Contributor

I don't think any of my flows are pointing to View layers, so that sounds wrong to me. Using the main FL should work, since that is where all the data ends up.

AkshayHarshe
Esri Regular Contributor

Agreed to the comment above. It is requirement of webhooks to have changes tracking enabled and ArcGIS connectors have the same requirements for you to trigger the webhook. Webhooks in ArcGIS Online—ArcGIS Online Help | Documentation

Thanks,
Akshay Harshe
0 Kudos
LouiseG
Emerging Contributor

Thank you @abureaux and @AkshayHarshe for getting back to me.I can confirm that changes tracking is enabled on the main hosted feature layer. 

I turned off the Power Automate flows connecting to the view layers and did some testing today with the Power Automate flows connected to the main hosted feature layer. I created a point on a view layer but it didn't generate a MS Teams notification, then I waited a few minutes and tried it again but got no notification. Then a few minutes later I created a point on the main hosted layer, within two minutes I got two MS Team notifications at the same time for all three created points. 

LouiseG_0-1762360402761.png

 

I have done some testing on the webhook using webhook.site. I do not receive a POST from the webhook when a feature is created on the View layer, but I do receive a POST when a new feature is created on the main feature layer. I have tested this with the webhooks created by Power Automate and with another webhook created in ArcGIS Online. 

0 Kudos
abureaux
MVP Frequent Contributor

What is your trigger for the flow? Anything that isn't on a schedule (e.g., something that runs every x minutes) can result in delays. For example, any time I have a flow with "When an item is updated", it can either trigger instantly, or a minute later. 

And to add on to that, email/email servers can also be slow. I've watch a multi-part approval flow finish to completion, and then 30 seconds later get several emails back-to-back for the different flow steps. Teams would be the same as this.

Personally, I hate the reactive triggers as they never seem to trigger when I expect them to. Also, I find the Survey123 reactive triggers (which I used a lot) very unreliable. Instead, I put everything on a schedule, and if nothing is found the flow is cancelled. I've never had a problem with this, and if an error is encountered, the flow can just reset and try again later. 

I will add that if you go with the schedule approach, you need a dedicated field that can updated by the flow so once something is processed, it isn't reprocessed unintentionally. 

AkshayHarshe
Esri Regular Contributor

Triggers by nature are reactive, what @abureaux is a way you can bypass the triggers and check periodically to see if there are changes. It does add overhead but could be useful in certain scenarios. 

How the webhooks are triggered is completely out of control of ArcGIS for Power Automate connectors. ArcGIS Online/Enterprise webhooks handle everything. Power automate is and our connectors will only know to run a flow when the Webhook says that it has new changes. The fetch action will get run extractChanges endpoint on Feature Server to retrieve changes that webhook collected. It is normal to have some delay running a webhook as someone making several edits to features layer(s) gets pooled to trigger once instead of making lot of requests.

 

Thanks,
Akshay Harshe
LouiseG
Emerging Contributor

Hi @abureaux and @AkshayHarshe 

Thank you both for your advice on my query. 

I was using the 'When a record is created in a feature layer' trigger, this works as expected when edits are made to the main hosted feature layer, but not when edits are made through one of the view layers. This seems to related to the webhook rather than the connector/trigger. 

I have recreated the flow so it is now on a schedule and uses a control field as suggested here: https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-in-power-automate-d... (again, thank you @abureaux for this resource). The flow now posts a MS Teams message regardless of whether the edits were made on the hosted layer or the view layer. 

0 Kudos