I set up a flow to send an email when a record is created in a feature layer in our citizen problem reporter solution. I use the "When record is created in a feature layer" connector and then the "get data from feature layer" action plus some other actions to pull the newest feature and parse the JSON before sending an email out.
When I click test in power automate and create a record in my feature layer it succesfully runs the flow and sends an email out but when I create a new problem in the citizen problem reporter nothing happens even though a new feature is successfully created. The flow is turned on and should be working. Any ideas on why this is happening? Thanks!
I have run in to similar issues when setting up web hooks and accidentally pointing to one of the feature layer views and not the feature layer itself. Can you confirm which feature layer the web hook is being created against.
Thank you for your response.
When I originally set up my flow I selected the layer form a dropdown in power automate from the ArcGIS connector. Just now I grabbed the feature Layer Id from the completed power automate record and when I looked that up in our system it shows up as a feature layer (not a view) but when I copy the url from that page into a browser it shows up as a featureServer with a different ID but shows the Service ItemID is the correct one (5fee9021128f4eb28efefc0b0e7ce024). I attached a couple screenshots to show you what I am talking about.
Let me know if that doesn't make sense but to me it looks like it should be connected directly to the feature layer right? Is there something I am missing? Should I actually be connecting to something else?
Good Day @MatthewAttiyeh1 ,
I was able to recreate the issue you were experiencing and I think I found a solution - it took a couple of steps, but I have gotten the web hooks to fire on submission of a request in the Citizen Problem Reporter Solution.
The feature layer that worked and fired the webhook was the 'Requests_reporter' which is a Feature Layer (hosted, view).
The next step was to confirm the 'Editing' settings are correct. For Power Automate to catch the web hooks, the 'Keep track of changes to the data (add, update, delete features)' must be selected. Initially it was not checked in the initial deploy of the Citizen Problem Reporter solution.
The next step was pointing to the Power Automate Trigger to the appropriate feature layer, which was 'Requests_reporter / undefined' and using the 'Fetch updates, changes, or deletions from feature layer' action to get the payload back from the web hook.
Hopefully this helps, if it doesn't please let me know and we can continue to troubleshoot the issue.
Thanks again for the help on this. The first few parts were good to go but I haven't tried using the fetch updates tool. I will play around with it and let you know if it works for me.
I have been playing around with this and realized I didn't properly describe the problem in my first message.
I thought it was only working when using the test tool in power automate but now I realize it works when the flow is turned on but only when I pull the feature layer into ArcPro and create a new feature. When I create a feature using our public facing app nothing happens but when I create a feature within ArcPro I do get an email.
The webhook seems to be set up properly including the keep track of changes button and I have also tried the fetch updates action instead of the get data action but I am running into the same problem. The webhook just never seems to be triggering if I don't create the feature in ArcPro so it doesn't even get to the fetch updates action. This doesn't make sense to me because the webhook is connected directly to the feature layer so I don't understand why it makes a difference where the layer is edited from as long as a new feature is added.
Just following up to let you know it seems like everything is working now! After connecting to the view layers and using the fetch updates tool everything seems be running smoothly. I appreciate all your help on this and thanks again!
I am glad we were able to help. I hope to have a blog posted on what we discussed to help others that might be running into a similar issue.