Select to view content in your preferred language

Survey123 Create Report action in Microsoft Power Automate (Preview)

25157
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
JamieKelly1
Frequent Contributor

I'm running into the same issue, did setting a timeout and retry policy solve the issue?

0 Kudos
RalphPlummer
Occasional Contributor

Hi @JamieKelly1 

Unfortunately, no.  What I did do that may have resolved this problem is refresh my Survey123 connection within Power Automate, since it is my connection that is used every time the flow is triggered.  My guess is that due to my organization, my OAuth token is expiring, causing it to fail.  My workaround has been to refresh the connection weekly.  I have not seen the flow fail with this same error since. 

I have however been getting failures due to the report generation timing out.  This is another issue I haven't been able to figure out, since I can go in and generate the report just fine and other triggers were successful right before and after the random failure.

Hopefully my workaround for the token issue resolves your problem though.  Thanks.

RalphPlummer
Occasional Contributor

Unfortunately this token issue has started up again.  My workaround did not solve the problem.  Can anyone explain why I keep getting this error?  I have had 4 failures this morning.

CarlisleHaworth1
Regular Contributor

Same with me, two failures so far this morning with the same error message related to the token. 

0 Kudos
RobertAnderson3
MVP Regular Contributor

I'm trying to create a webhook that will run on a weekly basis, using the Recurrence trigger instead of the when a Survey is Submitted trigger.

For this case, how does one include the ObjectID as dynamic content, it doesn't seem to want to give me that option.

Is it possible to set up a webhook to run a report on a timed basis?

0 Kudos
Paulvan_Heerden1
Occasional Contributor

Hi there

@IsmaelChivite I have created several flows that generate reports in Power Automate, then save them on One Drive, and then email them to the person that submitted the survey. 

In the "Create Report" section, I am giving the report a unique name using fields from the survey. I want to add the date to the name as well, but am struggling to get the formatting right. I know that I have to use the formatDateTime() expression, but I am just not able to get the syntax correct. My date filed in my survey is called q1_3_assessmentdate. I have tried using the following but it isn't working:

formatDateTime(triggerOutputs()?['body/feature/attributes/q1_3_assessmentdate'];DDMMYYYY)
 
Paulvan_Heerden1_0-1679578288122.png

Previously, in Integromat, I used to format it like below:

Paulvan_Heerden1_1-1679578288090.png

Please could someone explain to me how i format the date properly. I am not interested in the time at all, just the date

Thanks so much

RobertAnderson3
MVP Regular Contributor

If you're looking to use a dateTime field from your data you may need to include the add and convert time functions in the flow as it's stored in Epoch time, though I can't remember for the "date" type itself.

RobertAnderson3_0-1679587905173.png

Otherwise, if having the date that the webhook is triggered works you could always just used the timestamp function in Automate. I have the function as 

formatDateTime(utcNow(),'D')
 
With 'D' being the date format like Thursday, March 23, 2023. Some reference here: https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#...
Paulvan_Heerden1
Occasional Contributor

Thanks Robert

 

I was hoping that it would be as simple as it was in Integromat. There all you used was the format date expression. I will look into the info you have provided. Thank you

BenCunningham
Occasional Contributor

This is a great solution, thank you so much. My .pdf report is not coming through fully to my MS Teams/sharepoint folder though. It appears to work since it posts a .pdf file there and names it as I designated, but it cannot open and is only 3kb. Any ideas what I've done wrong?

0 Kudos
Paulvan_Heerden1
Occasional Contributor

Hi Ben

I ran into this as well. You are just selecting the wrong Dynamic value in the Attachment field. You have to specify the attachment (which is the actual content of the file that you are missing), as well as the Attachment file name. This is the one that you have correct because it saves a pdf with the correct name. You just don't have the contents correctly specified. Thus it gives an empty file

Paulvan_Heerden1_0-1680072704426.png 

In mine, I chose the Body from the Upload file from URL section. I think you can also use File Content from the Get file Content section

Paulvan_Heerden1_1-1680072744379.png

Paulvan_Heerden1_2-1680072831350.png

Just play around and see which works for you. I am sure you will come right

Paul