Extracting Survey123 data from Device

3005
11
07-24-2017 09:34 AM
Highlighted
New Contributor III

Some staff have been collecting data using an old version of a survey that points to a feature service that no longer exists. The data is stored in their sent/outbox folders. Is there anyway of extracting that data without having to manually write it down?

Tags (2)
Reply
0 Kudos
11 Replies
Highlighted
Esri Esteemed Contributor

Hi Nikholai,

We are working on some tools to automate the extraction of survey data as a data recovery workflow.  I've attached a fairly basic python script that will create CSV files based on the survey data collected. 

Reply
0 Kudos
Highlighted
New Contributor III

Hello James,

Is it possible to extract photos from the Survey123 SQLite database?

Yigal

Reply
0 Kudos
Highlighted
by
Occasional Contributor III

I believe those are not stored in the database, they can be found in the My Survey Attachments folder on your device.  ...\username\arcgis\My Survey Attachments

Reply
0 Kudos
Highlighted
New Contributor

Hello James, 

I'm running the script but keep receiving the following error:

inDB = sys.argv[1]
IndexError: list index out of range

I've tried debugging and cannot understand the issue, I would appreciate help.

Reply
0 Kudos
Highlighted
Occasional Contributor

We have a user with this issue. Have these tools been developed further? How would we go abut running the python on the phone, just from a  command line?

Thanks

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Adrian,

We are planning to improve the tools available, but don't have anything released quite yet.  You will need to copy the 'My Surveys' folder from the phone to a computer - iOS does not allow a script to run on a phone, and while it may be possible to run python on Android (I haven't looked deeply into that, but it's likely a developer has done it), the script above was not designed for any hiccups a python implementation on a phone might have.  See Troubleshoot—Survey123 for ArcGIS | ArcGIS for information on transferring the data.

Reply
0 Kudos
Highlighted
New Contributor III

I created a script to export a Survey123 SQLite database to a file geodatabase:

arcpy - Importing Survey123 SQLite Database from Device - Geographic Information Systems Stack Excha... 

Highlighted
by
Occasional Contributor III
arcpy.AddField_management(fcPath, str(tier2key), "TEXT")

File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 3424, in AddField raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000012: OBJECTID already exists Failed to execute (AddField).

I set up the SQLiteDB input as a File and the Output location as a folder.

Any advice?

Reply
0 Kudos
Highlighted
New Contributor III

Your ObjectId field is all in caps.  Two lines above the line that threw the error (line 89), try changing "objectid" to "OBJECTID"