I have a Power Automate flow that is triggered with the Survey123 "When a survey response is submitted" trigger. Part of that flow is the creation of a report, then the report is uploaded to OneCloud and attached to an email (see attached screenshot of the flow). This flow has been run hundreds of times, the vast majority of them have been successful; however, seemingly randomly, the flow will fail and it always fails with an error message of "A value must be provided for source path." (see attachment for failed flow run).
The Create report step reports that it has succeeded (green check mark), but when the Output of the Create Report step is examined, the jobStatus is "esriJobFailed" (see screenshot of output message).
It seems that there are two errors in the Create Report that can be the cause. Either
So, it seems to me that there is an error occurring when creating the report which in turn prevents the file (which is never created) from being uploaded and then attached to the email. This error is not consistent, because the flow will run successfully multiple times and then fail, then run successfully, then fail (see run history screenshot). Any idea what could be causing this?
An example of the full text of the Create Report output body:
I've run into similar issues here and there, this one happened last night then a few minutes later re-ran and it worked, no rhyme or reason.
{"error":{"message":"Layer specified by featureLayerUrl does not exist or is not accessible.500: Unauthorized access","code":"102","details":["500: Unauthorized access"]},"success":false}
I have set up my create report in a loop to try a couple times to try and catch any hiccups the servers throw, and I think unfortunately that's what this is. I think it helps, though I do never think to go back and check the ones that work.
I set a variable and capture the jobStatus and then use it for a condition to run until succeeded, but I set it to only try like 10 times so it's not stuck for forever. I also have it set up in a Scope (Try) so if it fails it sends me an email with the error message.
Hi @RobertAnderson3 thanks for this suggestion! I've run into the same issue a few times this year so I'm trying to resolve it for next year's flows. To clarify, do you have to initialize the variable first before setting it for reportSuccess? Do you mind sharing what the configurations look like (name, type, value) for all the steps? In addition, I haven't used "Do Until" before and I see it's nested within a "Try". How did you do that/can you help inform? Thank you!!!
Updated my flow and it looks visually different from yours, so not sure. Would like to make sure I have inputs correct before trying! (in case it keeps going on repeat)
Ya, the Create Report step has a tendency to randomly fail sometimes.
You need error handling to avoid any odd stoppages. One excellent method is suggested by @RobertAnderson3. I also have a guide that starts touching on this concept here.
If you can generate a report form the Surveys Site, the Create Report step in Power Automate should also work.