Select to view content in your preferred language

Survey123 Create Report action in Microsoft Power Automate (Preview)

21860
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
RobertAnderson3
MVP Regular Contributor

I have a report creating that includes a datetime field for start and end times to the users work.

However when the report is created in Power Automate, the time is showing as UTC not my local time. I see there is a UTC Offset setting in the Advanced Options but it doesn't seem to be doing anything for me.

I also was trying with ${enddatetime | utcOffset:"-3"} and it doesn't seem to do anything on my report either.

Any insights? Thanks!

EDIT: I figured this out, the setting needs to have padded zeros, so -03 or -03:00. What I've done to make sure the time changes are respected is add a utcOffset field to my surveys and added the calculation:

if(pulldata("@property", 'utcOffset')='-3','-03',if(pulldata("@property", 'utcOffset')='-4','-04',pulldata("@property", 'utcOffset')))

The property returns a -3 or -4, so I needed the if to pad it, if there's a better solve then let me know!

0 Kudos
KathrynCliftonGIS
New Contributor III

Good morning.  I have a step in my flow that converts the time zone.

addSeconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['Effective'],1000))
 
KathrynCliftonGIS_0-1686140147930.png

 

Kathryn Clifton, GISP, PLS
BenWilkerson89
New Contributor III

One solution is to use the following function: New Fire Inspection_@{addSeconds('1970-1-1', Div(triggerOutputs()?['body/feature/attributes/ReceivedDt'],1000), 'yyyy-MM-dd')}_@{triggerOutputs()?['body/feature/attributes/Address']}. Let me know if that works. 

RobertAnderson3
MVP Regular Contributor

@KathrynCliftonGIS @BenWilkerson89 

Thank you for the info! I have that set up in the webhook itself, but there's a value in the report itself that has the time with it and that's where it's not working properly. I don't believe the conversion in the webhook impacts that.

EDIT: So I found that it works if I type it in the right format, "-03" or "-03:00" which is helpful, but with Daylight Savings stuff I want to have it pulldata the utcOffset to use but it seems that attribute only provides "-3" which seems like a silly inconsistency.

0 Kudos
JasonPoucher2
New Contributor

Hi @IsmaelChivite ,  I'm trying to generate a report using the Power Automate webhook and I am getting an error on the Survey123 end.  The trigger is received by Survey123 but generate report job fails. 

JasonPoucher2_0-1686330978918.png

On the power automate side of things, this is the error:

JasonPoucher2_1-1686331055869.png

Has anyone seen this error before? Any idea where I might be going wrong?

 

0 Kudos
CindyThibeault
New Contributor

Hi there, can you drop your code here, I'm tring to do the same as you, and something doesnot work... i do not find the bug:/

 

0 Kudos
RobertAnderson3
MVP Regular Contributor

In the What's new in ArcGIS Survey123 (June 2023) blog Ismael posted, it mentions there's now a WHERE clause for summary reports, I know I saw a bunch of people asking so I'm going to post my example!

I set mine with a recurrence to happen once a week, created a variable for today's date, then set a variable for seven days ago, using the formula addDays(variables('todaysDate'),-7). Converted the time to my time zone and then built a where clause in the report for items newer than 7 days ago using that dynamic content (and checking if maintenance is needed).

RobertAnderson3_0-1686744716981.png

The steps after are the same as discussed for attaching it to an email. Sean McGinnis over in the Power Automate section of the Esri Community helped me with this!

0 Kudos
RobertAnderson3
MVP Regular Contributor

Hi @IsmaelChivite is there a limitation on the Create Report action where the token will timeout on a given interval? I've noticed a few times in the past month where my flows have failed and I have gotten 

RobertAnderson3_0-1687346538882.png


I remember this being an issue with the ArcGIS Connector itself, but never with the Survey123 connector, I've had it happen within the last 24 hours and on May 24/25th, and if I go to the Connections and re-sign in to the Survey123 connector the flow then works perfectly fine again.

Eimear
by
New Contributor III

Hi @IsmaelChivite, thanks for the info. I have a few WorkFlows working nicely with Survey123. But I am running into the same issue as @RobertAnderson3. The re-sign in workaround works for me too. But it would be great to know if there is a cleaner solve? 

0 Kudos
RobertAnderson3
MVP Regular Contributor

It is a 14 day timeout currently, it was mentioned here: https://community.esri.com/t5/arcgis-survey123-videos/survey123-tricks-of-the-trade-live-automate/m-... but not in any actual documentation I've seen.

The solve is between Esri and Microsoft sorting out the struggle.