Guide: Generate Feature Reports in Power Automate (Enterprise and AGO)

2877
10
Jump to solution
02-01-2024 10:30 AM
abureaux
MVP Frequent Contributor

As my old guide still gets activity from time to time, I figured it was appropriate to post an updated guide with the new Power Automate actions.

Attached As:
Power Automate - Basic - v3.pdf

Environments:

  • AGO
  • Enterprise

Requirements:

  • Power Automate Premium workspace.
  • Admin access to your Portal.

History:

  • v3 - Swapped 'status' for 'jobStatus' [24/02/02] Thank you @RobertAnderson3 
  • v2 - Added Appendix I - Fixing an old Custom Connection [24/02/01]
  • v1 - Original version.

Other Guides:

  • | Author: Esri
    | Original Post: Survey123 Create Report action in Microsoft Power Automate (Preview)
    | Attached as: N/A

    It is a very bare-bones flow that does a great job explaining the general concepts. I highly recommend you check this out if it's your first time looking at Power Automate and Survey123.
  • | Author: Me
    | Original Post: Guide to Generate Feature Reports in Power Automate (Enterprise and AGO)
    | Attached as: DEPRECATED_Old Method_S123+Power Automate - Basic - v2.pdf

    This is my old guide and I don't recommend that people use it (mainly because it is unnecessary since the new connectors were released). It still works though, and I have several old flows still using this method.
  • | Author: Me
    | Original Post: Generate Feature Report in Power Automate directly from Feature Layer
    | Attached as: N/A
    This is just a quick guide to showcase genreating a Feature Report directly from a Feature Layer (i.e., no webhooks). Webhooks have proven to sometimes be unreliable, so this is my first attempt at circumventing that issue. I will be building this out internally over the next few months to be a far more robust process.
  • | Author: Me
    | Original Post: Guide: Working with Nested Repeats in Power Automate
    | Attached as: N/A
    Here, I demonstrate how to work with Nested Repeats in Power Automate. This same principal can be expanded upon for additional nested repeats. If you have just a single repeat, the process should be straight-forward, but I can put something together for that if needed.
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

Please let me know if you have any questions or run into any issues. I do plan on adding a more advanced guide later, but don't have a timeline for that yet.

View solution in original post

0 Kudos
10 Replies
abureaux
MVP Frequent Contributor

Please let me know if you have any questions or run into any issues. I do plan on adding a more advanced guide later, but don't have a timeline for that yet.

0 Kudos
RobertAnderson3
MVP Regular Contributor

This is a fantastic guide @abureaux !

I wanted to drop a screenshot of mine using the AGOL Create report just to have that visible for people as well as the custom connector looks different.

RobertAnderson3_0-1706881034608.png

I'm going to have to try the HTTP - Get Report to try and skip the OneDrive steps that Ismael has in his samples.

Is your jobStatus is equal to valid the return because of it being a custom connector for the create report? In my AGOL version I have it looking for esriJobSucceeded.

I am also very interested in knowing more about your 2 stage process for reliability, always going to be looking for ways to improve that with these services. Is this related to how sometimes the trigger from a submitted survey just never finds it's way to Power Automate?

0 Kudos
abureaux
MVP Frequent Contributor

Thank you! I have only poked around AGO a few times so can always use more input regarding that process.

Good call on the "status" variable. That's what I also use, and intended to for this guide. Not sure why I grabbed status instead of jobStatus. Technically, status should work, but I feel that jobStatus is more appropriate (and intended) for this task. For anyone curious, there are two final "Status" in the Create Report step. One is jobStatus, which will either be esriJobSucceeded or esriJobFailed, and the other is status which will either be valid or not present. As I mentioned, the end result should be the same, but I will be updating the guide to use jobStatus as that is the intended parameter for this task.

RobertAnderson3
MVP Regular Contributor

I hadn't even caught that there was a separate status return on the create report function, I agree I think jobStatus is a better variable to look at, can process the esriJobFailed another way too if you want. I have my Create report in a do until loop with a count limit set just to try a couple extra times just incase the server randomly hiccups or something which I have experienced saving a couple runs.

And yeah any of the AGO questions I can definitely try and help out on as that's where all my surveys are based.

0 Kudos
abureaux
MVP Frequent Contributor

Regarding the two stage process, unfortunately no. If the survey never hits Power Automate, then there isn't much to be done. This one troubles me as well, but luckily it doesn't seem to be very common (I think I've only gotten one complaint in the last 6 months - and that's out of thousands of surveys).

The two-stage process protects mainly against two things:

  1. SharePoint glitches. From time to time, I've seen SharePoint do some random things, such as items not getting entered into lists for instance; and
  2. Esri report generation glitches (both small and large). This one seems more common. Sometimes the report generation service just doesn't want to work first try, but second try it runs flawlessly. I am also protected against large service outages and bugs in the report generation service. While this is more rare, it's happened three times that I can remember in the last couple years, and each time I just had to tell people "reports will be delivered soon. Just keep submitting like normal". Other than Feature Reports being a day or so late, I didn't have to change a thing on my end to get those reports delivered.

There are a few other miscellaneous things it covers against, but I am thinking that they are more corporate-environment specific, such as missing corporate emails when our IT doesn't add someone to the proper user group (rare, but it has happened). Overall, I've found the two-stage process it to be very self-sufficient.

The biggest hurdle I have right now is users ignoring approvals and letting things timeout. The timeout itself is covered by the error handling, it's more that people aren't doing what they should be! 😂 On a side note, for anyone using approvals in Power Automate, there IS a way around the 30-day limit of Microsoft approvals now. I feel like this isn't well enough known at the moment.

RobertAnderson3
MVP Regular Contributor

Yeah that's been my struggle too, it doesn't happen often at all so it's really hard to troubleshoot (and I think beyond our abilities anyways) but I've started looking at the ArcGIS RobertAnderson3_2-1706895738881.png connector instead for some of our uploading tasks to run it on a timed basis instead of relying on the Survey123 submit trigger. This also helps my struggles of getting survey updates into the table they need to be in (updating the row, not adding it again).

Being able to skip those issues sounds great, definitely find myself spending too much time on the 'oops something didn't work today' side of things, but that also comes down to finding user error a lot. The loop I put the create report in helps for the generation glitches but doesn't hold anything for the larger outages.

0 Kudos
MichelleWilliamsERM
Frequent Contributor

Thank you for your clear documentation for Power Automate.

Here's something we've learned along the way, you are welcome to add this to your directions in the future. 

~~~ PLEASE change the name of your Power Automate Flow in the screen below, so you don't over write it when you build a second flow, PLUS you'll know which flow is which.

We found that if we didn't update the name, then Power Automate overwrites Flow 1 with Flow 2.  

May the surveys always be in your favor!

MichelleWilliamsERM_0-1715202830374.png

 

0 Kudos
abureaux
MVP Frequent Contributor

Power Automate has been overwriting your Webhooks in the Surveys Site? That isn't normal behaviour, but I've both heard of and seen it happen in the past. Essentially, Esri's service only allows a single webhook created by Power Automate at a time. Honestly, I don't recall there being a specific fix for this issue when it last appeared. It kind of just came and went on its own. But that behaviour isn't normal or intended, so it may be worth pulling in support to at least log it as an issue?

However, if you are able to rename the webhooks to bypass the limitation, than that sounds like a good workaround.

0 Kudos
MichelleWilliamsERM
Frequent Contributor

Renaming the file works for us, we have several flows on one hosted service. We use this when we are building out a second flow and need to keep the first one intact for LIVE data. 

0 Kudos