Select to view content in your preferred language

Survey123 Create Report action in Microsoft Power Automate (Preview)

19852
67
01-30-2023 12:43 PM
IsmaelChivite
Esri Notable Contributor

[Updated July 2023: Added new note with link to a more recent and complete video]

 

Note: You may want to watch this video instead for a more recent take at this functionality

 

Just a few days a new Create Report action was added to the ArcGIS Survey123 connector for Microsoft Power Automate. While this action will not be officially documented or supported until the upcoming February 2023 release (currently planned for February 22), you can start playing with it now.

The video below will give you a quick tour to get you going. Enjoy!

If you have any feedback, please let us know by posting a comment below or adding your comments to the Survey123 Early Adopter Community website.

Note:  Since this action was added to the connector, some of you have reported that any flow previously authored from a Microsoft Power Automate template, stops working when you edit it. To resolve this issue, the Survey123 connector needs to be deleted from your flow and added again.  We are working to understand if this problem can be prevented or not. 

67 Replies
RalphPlummer
New Contributor III

This might not be your issue, but I'm hoping this might help others who are experiencing this error. 

Based on my past experiences with this error, it was due to the fact that the report was not generated, resulting in that error since there was no report to upload.  While Survey123 showed it passed and did not fail, it technically failed.  Most often than not, it was due to a missing token due to my Survey123 connection expiring after 2 weeks (organization policy).

Check your Survey123 create report raw output to see if it says esriJobSucceeded.  If it does not say that, then your report was not generated.  See my screenshot where it shows it passed, but no report was created for it to upload.

I hope this helps out.  

RalphPlummer_0-1707227425041.png

 

0 Kudos
SeanNagy1
New Contributor III

You appear to be incorrect in that a report was not created even though it  showed no error. How do you correct the Survey123 connection expiring without recreating the entire flow?

0 Kudos
RobertAnderson3
MVP Regular Contributor

The Survey123 token that's used for the Create report action times out every 14 days currently, have been pushing Esri to update this but they have to work with Microsoft so it's a slow process (they have recently updated the ArcGIS Online connection to remove this limitation)

To refresh your connection, click Connections on the side of the screen, then find the Survey123 one and click Switch Account and then just sign in again with the same credentials. And set a reminder to do this every 13 days until Esri improves this.

RobertAnderson3_0-1707242138559.png

 

0 Kudos
FionaNicholls
New Contributor II
Thanks for that, very helpful info. I was wondering why my Power Automate flows fail regularly!
FionaNicholls
New Contributor II
The "apply to each" is because you are selecting a url path that is different to the one you should be using. One Drive url - url from the first result file. And yes, periodically the flow fails, either because it has lost the path to the survey or it has lost the path to the url.
0 Kudos
Stephanie1
New Contributor

Is there a way to pick a report template based on an attribute? I currently have three different flows, one for each template, but I would like to combine into one flow. I'm looking for guidance on how to tell power automate to use template 1 if attribute x equals 1. Use template 2 if attribute x equals 2, etc. I've tried using conditional statements but the flow is only successful for the first statement. 

0 Kudos
CarlisleHaworth1
New Contributor III

I've done something similar where I populate a different excel file on sharepoint based on a specific value of an attribute, using multiple conditional statements which are setup parallel to each other. Try adding a dummy Compose as the very first step after the Yes condition, and do nothing after the No. See the following for more details on the dummy compose: 
Solved: Add Parallel Branch After Condition - Power Platform Community (microsoft.com)

 

0 Kudos
RalphPlummer
New Contributor III

Hi @Stephanie1 

There is more than one way to accomplish what you want, but if you want to do so using an expression in the report template field, here is one way based on your example above:

 

if(equals(triggerBody()?['feature']?['attributes']?['x'], '1'), '2b5b3e02f2de43b6b5026f07a5021fe9', '2e0d45fe4ed241a3894c452b0f648933')

 

It goes without saying but ensure you replace the template IDs with your own. 

I have used one where it chose between 4 different templates based on two different attributes.  See below.

 

if(and(equals(triggerBody()?['feature']?['attributes']?['form'], 'tg'), equals(triggerBody()?['feature']?['attributes']?['rvra'], 'no')), '2b5b3e02f2de43b6b5026f07a5021fe9', if(and(equals(triggerBody()?['feature']?['attributes']?['form'], 'tg'), equals(triggerBody()?['feature']?['attributes']?['rvra'], 'yes')), '524bce6140394447a271cf2246617772', if(and(equals(triggerBody()?['feature']?['attributes']?['form'], 'mp'), equals(triggerBody()?['feature']?['attributes']?['rvra'], 'no')), 'b5b664adb80243658bbbc9545c0f04d0', '2e0d45fe4ed241a3894c452b0f648933')))

 

 I hope this helps.

0 Kudos