Select to view content in your preferred language

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

7699
31
Jump to solution
04-18-2022 01:41 PM
abureaux
MVP Frequent Contributor

> Go to the updated guide! <

This post describes the old manual method of generating Feature Report within Power Automate. Technically, this method does still work, but it is a LOT of extra work. There is a much easier method now! Check out my post above for more details.


I have tried to post this several times over the last few days, and it has kept failing. As such, I have opted to go with an attachment. My apologies for the extra download and mediocre formatting!

This is a guide for users new to using S123 in the Power Automate (PA) platform, and is a repost from an earlier post I made. That thread is kind of hard to follow now because I didn't start it, and this is also an updated flow to fix a bug with geopoint questions not working before. The guide fully details how to generate a feature report for S123 using PA.

Please let me know if you have any questions!

Environment:

ArcGIS Enterprise.

AGO has a new built-in connector. Just use that rather than trying a custom approach. 

Requirements:

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

Scale:

This guide is for a simple one-step flow. I do not recommend this for large-scale deployments as it does not have adequate error handling capabilities. I use a two-step process which I can detail later. Basically, I dump the initial response from S123 into SharePoint and then process that. This will give you all the basics though!

Versions:

  • v2 - Updated step for the Do Until loop
31 Replies
Blevins_Mark
Frequent Contributor

I got it to work by changing the referer in the token request to survey123.arcgis.com...i was confused because i made that change initially and it still failed...but that was because i had the work item id for my template lol...but that workaround seems to work for me. Thanks.

abureaux
MVP Frequent Contributor

Glad to hear it's working now. Hopefully this silly error stays away for you!

0 Kudos
Blevins_Mark
Frequent Contributor

sorry have you also seen this error as well? trying to open the output report and get a message saying "word found unreadable content in (yourfilename). Do you want to recover the contents of this document?" clicking yes opens the file but with none of the information pulled from the survey. There is really no rhyme or reason and it is intermittent, sometimes happens and sometimes does not. Thanks.

0 Kudos
abureaux
MVP Frequent Contributor

I have. But, I don't have anything specifically to attribute to it. The typical culprits include:

  • Tables (these can be tricky sometimes).
  • Content Control elements (example below).
    abureaux_0-1705602597382.png
  • Comments.

In most cases, it's a tag crossing some element resulting in unintended consequences. E.g., When content is dynamically added or removed while crossing a comment, it can result in this error. Example of how to not place a comment in a Feature Report:abureaux_2-1705602870348.png

Sometimes, the easiest solution is to play 20-questions with your document. E.g., Cut out the bottom half of the content and then run the report. If the issue persists, restore the bottom half, remove the top half, and run the report. If the issue is resolved, restore the cut content, and then cut the restored content in half.

Essentially, you are just narrowing down where the error is originating from.

If you are having trouble, you can upload your Feature Report and I can have a look.

0 Kudos
Blevins_Mark
Frequent Contributor

Much appreciated. Attached is the template im using.

0 Kudos
abureaux
MVP Frequent Contributor

That's quite a small Feature Report, and I didn't see anything obviously wrong with it. Would you also be able to include your XLSX so I could recreate this and try a test submission?

0 Kudos
Blevins_Mark
Frequent Contributor

it looks like maybe its bundling a bunch of different of  surveys together and calling it .docx file, when its actually a zip file with multiple submissions...for some reason...but not all the time lol...anyways attached is the excel...thanks again

0 Kudos
Blevins_Mark
Frequent Contributor

i think my smarter-than-me colleague  figured out the issue, needed to make a change to the  queryParameters so that it only generate a report for the submitted record that triggers the flow as the objectid is unique. thanks for your help.

MariusVerdes
Regular Contributor

Hi @abureaux ,

Thank you so much for posting your flow here. I tried it today, but unfortunately, I am receiving an error, please see the following code and screenshot:

"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>404 - File or directory not found.</h2>
<h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
</fieldset></div>
</div>
</body>
</html>"

MariusVerdes_0-1706711465001.png

Have you ever encountered such an error? If so, how did you resolve it? 

Thanks in advance.

0 Kudos
abureaux
MVP Frequent Contributor

Hello.

I will have to edit my post as this is quite old now. I will try to get a simplified guide out in the next day or so, but I also want to include a complex guide for a more robust flow later.

Technically this method does still work, but Esri has released a new module for Enterprise users (and AGO) that can generate feature reports MUCH easier.

I highly recommend swapping to that method. Here is the blog.

The one issue you may run into is with the Custom Connector. If your Custom Connector is old (like mine was), then you will not see the new Create Report action.

If you want to know if your connector is up to date: Go into any flow > add a new step after your trigger (any trigger) > go to "Custom" > check for the "Create report" step (pictured below)

abureaux_1-1706716503567.png

If you see "Create report", you are good to go!

If you don't see "Create report", you have three options:
1) Delete your old trigger and make a new one (If you have a lot of flows, I don't recommend this),
2) Make a new trigger with a new name and come to terms with all of your old surveys using a different trigger (my OCD wouldn't allow for this option), or
3) Make a new Custom Connector, copy the code from it and paste that new code into your old trigger (While I was terrified of breaking everything doing this, it worked beautifully. I was left with a single up to date Custom Connector, and no surveys needed to be updated by my users. A win-win!)

-------

Regarding your actual question 'no', I haven't actually seen that particular error before. My only thought is that something is wrong with the URI. Rather than fight with this method though, I'll loop back to my original suggestion of swapping to the new method.