Create Feature Report in Microsoft Flow - Power Automate

6148
17
Jump to solution
06-01-2020 05:02 AM
AdminAccount2
Occasional Contributor II

Currently what is the best method to create feature report from Survey123 in MS Flow/Power Automate?

I have this process running successfully in Integromat, but am looking at transitioning this over to MS Flow (Power Automate)

 

There is no "Create Feature Report" module in MS Flow like there is in Integromat. I did notice in another post there is a (Premium) service in Flow called "Populate a Microsoft Word Template". Is that the only way now to handle this process in Flow?

Is there another "Create Feature Report" module planned for releasing in MS Flow? Since the "Populate a Microsoft Word Template" is a Premium service, I cannot access that to try.

17 Replies
Ruth_JiatengXu
Esri Contributor

Hi @ZoltanKelly @TMaddio @PrachiPatel 

The link that James provided is the instruction on how to use Report REST API, and the developer documentation for the Report REST API is now publicly available on https://developers.arcgis.com/survey123/api-reference/rest/report/. You can try using the REST API with power automate to generate report.

Thanks,

Ruth

ZoltanKelly
New Contributor III

Hi @Ruth_JiatengXu  - thanks. The documentation is no longer accessible in the Early Adopter community - the message on the page is 'The page you are attempting to access is unavailable.'. it's not visible anywhere in the documentation section either.

However with the REST API docs i've managed to kludge a workflow as an Azure Logic App (which is ~Power Automate aka MS Flow) but allows for pay per use instead of fixed costs for their 'premium' HTTP connecter (as of July 2021).

Below is for reference for anyone else. python would be neater but Logic Apps meets our requirements to schedule and manage.

ZoltanKelly_0-1626776627023.png

 

JoseVidal
New Contributor III

Can you post the details of your workflow above? Open up the boxes and let us see what the URLs/params/etc. is inside them? Thanks!

 

 

ZoltanKelly
New Contributor III

Hi, here are expanded steps. note:

1. this probably could be a heap cleaner but just conceptually can get you started

2. see these docs to understand logic of the api - Report | ArcGIS Survey123

2. this is sending a specific email for a specific form. intention is we refactor this so it grabs all the parameters (source form, email subject/body/addresses, anything else) from a table so we can have a single flow running that can be dynamically picked up.

ZoltanKelly_1-1632014874245.png

 

0 Kudos
AdminAccount2
Occasional Contributor II

Hi Zoltan,

Thanks for posting that. I recreated that flow and everything works - except if the report template contains a geopoint type question, then it fails with:

 ["An error occurred when rendering by the report engine.  Failed to print map for `$map_geopoint`.  waiting for function failed: timeout 180000ms exceeded"]

If I remove the geopoint question from the MS Word feature report template, then it works fine and generates the report from the Flow API request. When the geopoint question is included, the report generates normally without error from the Survey123 web site, but fails if called from the Flow API.

I have already opened a support request with ESRI on this issue, but so far we have been unable to resolve this. The query works and everything is returned, but it seems like it cannot access the map used for printing the geopoint in the MS Word feature template. 

We have tried  many things to to resolve this, including adding the webmapItemId and mapScale parameters and trying different formatting of the request within Flow and also using Postman, but nothing seems to work when a geopoint question is included.

Just wondering if you or anyone else has tried including a geopoint question in the MS Word feature report and then using the API request from Flow to generate the report.  Has anyone successfully done this, had similar issues or found a way to resolve this problem? I'm testing with a report template that is very basic - one question and one geopoint... no repeats or anything.

0 Kudos
AdminAccount2
Occasional Contributor II

Thanks to James Tedrick at ESRI - the solution to the issue we were having generating reports using the Create Feature Report API in Microsoft Power Power Automate has been resolved. The issue was a bit difficult to diagnose, since everything worked as expected except when a geopoint question was included in the report template, then it could not render the map on the report and the process would timeout.

The solution is to make sure the generateToken API request in the flow includes the value referer=https://survey123.arcgis.com

generateToken.jpg

 

0 Kudos
WalterWilliams
New Contributor II

I am also interested in the link above. would be grateful if it is shared here again. 

Alison_Gou_
New Contributor III

Try out  Survey123 Create Report action in Microsoft Power Automate (Preview)

There is a new Create Report action you can insert into your workflow directly.

Alison