I have a public survey that is filled out for a rental fee waiver. There are hidden fields that a manager will fill out to approve or deny this request. This step is locked down to a managers group on AGOL. So far I have a PA flow that emails the filled out survey to the manager, and the hidden fields are exposed and editable. I'm trying to figure out how to resend the survey after it's been edited by the manager to the rental department. Can I do this in a single flow? Maybe a second "When a survey is submitted" trigger? I'm thinking the survey global ID doesn't change with editing though. Is anyone doing something like this?
All my (new) automations are kicked off via Get data from feature layer and a WHERE query of prime_process='FALSE'.
I have this field in my surveys:
Every time a survey is submitted/resubmitted this parameter is reset, and thus the form is reprocessed.
Could work in your case as well.
EDIT: Obviously, something like this will only work if you are using something like S123 to do the editing. If they are editing fields in the FL directly, you could just add a dropdown column to the FL with two values and then give them instructions to manually change that dropdown each time they submit. Will have the same effect in the end. All you really need is a way to kick off the flow reliably.
Thanks! I will try this. The editing will be happening exclusively in S123. The manager will be getting an URL link to the submitted survey which they will edit.
Opps. I was on the forms because of the outage and responded quickly... I left out the other half of the flow.
Using my previous example, you need to toggle that value of "FALSE" to "TRUE" so that Power Automate doesn't keep looping over the same row. Again, you can technically use any two values you want for this process. I just arbitrarily chose "TRUE" and "FALSE" (as text fields, not boolean).
I use the "Update a record in a feature layer" step to do this.
Next, I use Power Automate's built in "Run After" to handle errors by collecting the objectid for all failed runs and then using a second "Update a record in a feature layer" to reset those "TRUE" values to "FALSE" so Power Automate tries again. In the case of issues like yesterday, my flows stopped working during the outage, but then started up again after Esri fixed the issue.
Here is a quick example:
And lastly, it is probably also worth mentioning that I use the "Recurrence" as my flow trigger. In my case, my flow runs ever 5 minutes. Example:
The condition simply terminates the flow when "Get data from feature layer" returns 0 features. If a feature is returned, it continues past this point. This is the expression I used:
length(outputs('Get_data_from_feature_layer')?['body/data'])
Beyond this, I will mention that there is a "Update a record in a feature layer (batch)" connector which I am not using yet, but may start to in the future as it is much faster for large jobs. It works similar to the "Update a record in a feature layer" connector, but requires JSON as input. Here is a quick example of that as well:
{
"attributes": {
"prime_process": "TRUE",
"objectid": @{items('Apply_to_each_-_featureArray')?['Attributes/objectid']}
}
}
Ah thanks. I can only use the S123 connectors because my hosted survey layers don't show up in any of the ArcGIS connectors.
The Esri connector is bad at displaying layers, especially if you have a lot. Have you tried adding the FL to your favourites in Portal? I find that the favourites list (as long as it is small) works much better.
I favorited them and they showed up in fetch changes. But I'm not sure how I would use that. Here's how my flow looks. It actually works the first time, but it takes forever for the final email to go through. And that's me filling out and editing the survey immediately after receiving the first email. So it seems like to do need to reset something, I'm just not sure how to go about it. The two S123 connectors are identical with the same global ID. What I really need to figure out is how to kick off the last email when the survey_mode has changed from "new" to "edit"
Would you mind sharing a little more about how you implement this?
Is anyone accomplishing something similar to this with a single survey in a single flow?