TransWikia.com

Survey123 Python Module Feature Report Names

Geographic Information Systems Asked on February 2, 2021

I am using Survey123 version 3.9 and the ArcGIS API for Python. I am successfully downloading reports, but I seem to have no control over the report file name. The test file name I am using is "Feature Report Title", but the file name of the report ouptut is "SurveyNameOIDXXXYYYYMMDDxxxxxx". When I don’t specify the URL of my organization’s ArcGISOnline account for GIS(), I see "Feature Report Title" in the survey’s Report –> Recent tasks pane on Survey123 for a failed report download, but the report failed to download, and I get this message, "An error occurred when uploading result files to Portal for ArcGIS. 498. Invalid token.". Can I control the file name of the generate_report() outputs? I read this, https://community.esri.com/t5/arcgis-survey123-questions/survey123-report-feature-how-to-change-the-word-doc-file-name/m-p/829348#M17993, which seems to indicate that in early 2019, controlling file names was not an option.

Here is my code:

username = 'myname_organization'
password = 'password'
template = 1
utc_offset = '-07:00'

gis = GIS("https://organization.maps.arcgis.com", username=username, password=password)
sm = arcgis.apps.survey123.SurveyManager(gis)

survey_id = 'some unique identifier'
where_clause = 'objectid=someOID'
report_title = "Feature Report Title"
templates = survey.report_templates
survey.generate_report(templates[template], where_clause, utc_offset, report_title)

for x in survey.reports:
    if survey_id in x.description:
        data_item = gis.content.get(x.id)
        data_item.download(save_path=r'DownloadFolderPath')

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP