You can automate data capture workflows using the ArcGIS API for PythonSurvey123 module. With this module, you can identify properties of surveys, download your survey results, display survey results in a Pandas data frame, create reports, and manage report templates. Other modules in ArcGIS API for Python also allow you to share your surveys, link content to your surveys, clone surveys between organizations, and work directly with their underlying feature services.
The following samples demonstrate features of the ArcGIS API for PythonSurvey123 module, as well as automation workflows to help you expedite Survey123 tasks. The samples show how to use Python to accomplish many tasks, such as automating report generation, updating the contents of the Survey123 media folder, and cloning surveys from one organization to another. Most samples are in the form of a Jupyter Notebook that can be viewed online or downloaded and run interactively. Some samples are provided as stand-alone Survey123 scripts that should be downloaded directly from the Survey123-tools repository.
Go to the Survey123-tools repository and clone the repository to run the notebooks locally on your computer. You will also need the ArcGIS API for Python installed on your computer. To learn more, see Install and set up.
Alternatively, you can run the samples in ArcGIS Notebooks by clicking the Try it live link on each of the following pages in this guide. If you are signed in to your ArcGIS account and have ArcGIS Notebooks privileges assigned, you can Open Notebook directly in your browser. If you are not signed in you can Download the notebook only.
The Survey123 module allows you to connect to your surveys so that you can perform operations. To connect to a survey, complete the following:
Sign in to your ArcGIS organization by running the following command in either a Python script or Python console:
gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>")
Define a Survey Manager, which will contain all available survey projects and their item information and properties.
survey_manager = arcgis.apps.survey123.SurveyManager(gis)
To learn more, see Work with the Survey Manager.
With a Survey Manager defined, you can now analyze, report on, and access data of all the available surveys.