flow works when testing but doesn't work in real world

1752
13
06-27-2022 09:31 AM
MatthewAttiyeh1
New Contributor II

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!

0 Kudos
13 Replies
SeanKMcGinnis
Esri Contributor

Hi @MatthewAttiyeh1 

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.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
MatthewAttiyeh1
New Contributor II

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?

citizen problem.JPGcitizen problem2.JPG

0 Kudos
SeanKMcGinnis
Esri Contributor

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 red arrow is pointing to the feature layer view that is edited when a request is submitted through the Citizen Problem Reporter solution.The red arrow is pointing to the feature layer view that is edited when a request is submitted through the Citizen Problem Reporter solution.

 

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.

Make sure the 'Keep track of changes' check box is selected.Make sure the 'Keep track of changes' check box is selected.

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.

Screen Shot 2022-06-28 at 12.17.18 PM.png

 

Hopefully this helps, if it doesn't please let me know and we can continue to troubleshoot the issue.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
MatthewAttiyeh1
New Contributor II

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.

SeanKMcGinnis
Esri Contributor

@MatthewAttiyeh1 - sounds good, please let me know how it goes.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
MatthewAttiyeh1
New Contributor II

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.

0 Kudos
MatthewAttiyeh1
New Contributor II

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!

SeanKMcGinnis
Esri Contributor

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.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
NataliyaLys
Occasional Contributor II

I'm also trying to set up Power Automate to send an email notifictions when reports are submitted through ArcGIS Citizen Reporter application. And I'm running into an issue with one of my flows. 

Here is my workflow:

1. Report is added through the citizen reporter

2. Status value 'Submitted' is assigned by default, when report is created

3. I have a python script running every 5 minutes, the scripts checks all new features added and based on location of the feature, it calculates' Geographic Assignment' field for each added report

4. Once 'geographic assigment' field is calculated I would like my Power Automate Flow to run, and make some aditional updates to the feature, and then send an email. 

5. The flow is getting triggered, but it doesn't seem to pick up the edits so condition is not met and email is not getting sent. 

I cannot figure out why the flow is not recognzing the update to the 'Geographic assignment' field? 

A side note, the flow will run if I manually edit one of the fields (after 'geographic assignment' field was already populated)

Here is my Flow:

NataliyaLys_0-1695850335009.png

 

 

 

0 Kudos