survey.generate_report flakily returns None

347
3
11-05-2019 09:47 AM
BrianPugh
New Contributor
Hello, I'm experiencing an issue with the ArcGIS Python API for Survey123 (version 1.7.0) where a call to generate_report on my survey object unpredictably returns None. I have previously seen this behavior in cases where the "where" parameter results in an empty selection, but I'm now seeing it in cases where I select a global_id that definitely exists. The code works most of the time, and has so far worked in these cases when I retry the script, but having flaky issues makes it difficult to identify actual issues.
Is this a known bug? If not, I'd be happy to provide more details about our scenario to allow further investigation.
0 Kudos
3 Replies
DanMallett
Esri Contributor

Having a similar issue.  It seems to be related to issues with the template but it is difficult to debug.  Did you get anywhere with this problem?

0 Kudos
BrianPugh
New Contributor

Hi Dan, it mysteriously stopped happening for me (not related to any Python API updates or code changes on my end). I would add though that mine would return None for a particular data point/template combination, then subsequently work for the same report, so the template wasn't reliably breaking anything. Perhaps there's some bunk error handling going on on the AGOL side that returns None for a class of issues.

I also encountered a case at one point where None would be returned if your filters cause an empty result, but that's somewhat more expected.

By the way-- wouldn't suggest going through support unless you have a surefire way to reproduce it.

0 Kudos
DanMallett
Esri Contributor

Thanks Brian, i think I figured out at least part of the problem is that your Enterprise needs to be externally accessible as the survey123.arcgis.com reporting service actually needs to query it. 

0 Kudos