I am trying to automate the report generation of a survey123 survey.
I have tried both in my orgs AGOL Notebooks as well as in a dedicated python IDE (PyCharm in this case, changing the GIS parameters accordingly).
The Notebook keeps saying it is generating a zip in a tmp location. I cannot find that location, and I need it to output PDFs not in a zip file.
Here is my code:
import arcgis
from arcgis.gis import GIS
gis = GIS("home")
survey_manager = arcgis.apps.survey123.SurveyManager(gis)
survey_by_id = survey_manager.get("mySurveyID")
template = survey_by_id.report_templates[0]
pdf_report = survey_by_id.generate_report(template, output_format="pdf")
print("Single report as PDF: ", pdf_report)
You are missing a couple of parameters to help control the output.
If I am always generating/downloading at least 2 reports at a time, is it always going to be a zip file?
yes if your query is set-up that way. Two solutions to that: