Select to view content in your preferred language

Survey123 Tricks of the Trade (Live): Automate Reports

14941
22
07-06-2023 11:33 AM
IsmaelChivite
Esri Notable Contributor

 

On July 6, 2023 we recorded a Tricks of the Trade session covering Survey123 report automation with Microsoft Power Automate. Thanks to all attendees!   In this post you will find the recording, resources and Q&A.

Highlights


Survey123 includes a report service. With it, you can create beautiful PDF reports including maps, photos, tables and more. Build your own reports for compliance, to document the work you do, to share information with stakeholders in a format they are familiar with or simply to create high quality printable documents.

If you are not familiar with Survey123 reports, check this recording first.

Using the Survey123 connector for Microsoft Power Automate, you can automate report generation. This webinar demonstrates how you can trigger reports when a survey is sent, and on a schedule.

Recording

 


Slides


Find the slides at the bottom of this post (They are attached in PDF format) or click here.

 

Q&A

 

  • Where is the  April session recording covering the Reports intro? Here
  • What is the price of Microsoft Power Automate? You can try Microsoft Power Automate for free for a limited period of time. Standard subscription pricing available here.
  • Is the new Create Report action Premium? No. The Survey123 connector (including all its triggers and actions) is not a Premium feature of Power Automate. However, report generation consumes ArcGIS Online credits (unless you are creating reports from ArcGIS Enterprise).
  • What if I don't have Microsoft Power Automate? How can I automate reports? You can use the Make.com connector to automate reports. Additionally, you can use the Survey123 REST API from Python or any other tool that works with REST APIs. FME Server is a good example of such a tool.
  • Can I use the Survey123 Connector and Power Automate with ArcGIS Enterprise? Yes. Check this Esri Technical Article for details.
  • Why my flow fails stops working after 2 weeks? Because the Survey123 connection expires after two weeks. Refresh the connection in Power Automate to keep it going. The team is working to address this problem.
  • Do I have to upload PDF reports into OneDrive before I can include them as an attachment in an email? Yes, unless you can find another way to do it! 🙂 If you worry about having the files in OneDrive, add a Delete File action at the end of your flow, once the file is attached to the email message.
  • How do I refresh my Survey123 connection in Power Automate? In Power Automate, go to Data -> Connections -> Survey123. Click on switch account and re-enter your credentials again.
  • Can I automate reports in Make.com? Yes, the report action is available in Make.com. The only thing missing is the WHERE parameter, which you will need in case you want to schedule your reports. We are planning an update to the Make.com connector soon to include the WHERE parameter.

 

 

22 Replies
KhemAryal
Regular Contributor

I am not able to create flow. I keep getting the error

KhemAryal_0-1688674335825.png

 

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi @KhemAryal   Check the output of the Create Report tool. I bet the problem is there. For some reason, the PDF could not be created and then the next module fails because a required input for it is empty.

Looking at the Create Report parameters (the WHERE clause in particular) is important to diagnose the problem.  I am guessing that the WHERE clause you included is not returning records. No records, no PDF... nothing to upload.

KhemAryal
Regular Contributor

@IsmaelChivite You are right. Report was not created in the output as I did not put correct syntax at Where clause. 

what would be the 'Where' clause syntax if I just want to see the records for the last month. I can do for last 30 days but not all the months are 30 days. There should be easy way to do it but I kept failing. any suggestion?

0 Kudos
SayedWali
Regular Contributor

In Create report, make sure you take the url with the text (url of the first result file):

SayedWali_0-1688676583744.png

 

then follow other steps.

 

MiltonSolano
Frequent Contributor

Excellent presentation. It's a shame that the features for editing and updating items hosted on ArcGIS Online are Premium options. The option to update a URL Report after the report creation is a great idea, blocked with the premium paywall.

0 Kudos
SayedWali
Regular Contributor

Hi Ismael,

Watched the video till the end and it's impressive, especially when it comes to editing a record in the feature layer by using ArcGIS action in flow.

However, it would be great if the Survey123 connection expiration is resolved. I face this issue every two weeks either for scheduled flow and "When a survey response... " trigger.

DevinCarlson
Occasional Contributor

Thank you for posting this @IsmaelChivite - This video was very much needed.

I'm working on a scenario:

A S123 form is submitted.  If ${Municipality} = 'x1' follow FlowA (Use Report Template A, email to one group of people)

If ${Municipality} = 'x2' follow FlowB (Use Report Template B, email to a different group of people)

I have the flow set up and it actually works (see image) but - If the S123 report is not created because it is not for that municipality, then the rest of that branch fails (makes sense - there is no report). 

The where clause says: Municipality = 'x1' 

and then for the other create report it says: Municipality = 'x2'

Here's my question - is this ok?  Or is there a better solution?  Power Automate thinks it failed because there is no report to upload.  But I do not consider it to have failed because it created the correct report and emailed the correct content.  Should I leave this alone or will this get me in trouble later down the road?

DevinCarlson_0-1688738554884.png

Appreciate any advice!

0 Kudos
IsmaelChivite
Esri Notable Contributor

@DevinCarlson  I think a 'condition' should help here. Check: https://learn.microsoft.com/en-us/power-automate/add-condition 

DevinCarlson
Occasional Contributor

Great!  Thank you - I will try to incorporate this. 

As always - appreciate your help @IsmaelChivite!

0 Kudos