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?
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.
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
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.
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 Exchange
<SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">arcpy</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">AddField_management</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">fcPath</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> str</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">tier2key</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">),</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px;">"TEXT"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN>
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?
Your ObjectId field is all in caps. Two lines above the line that threw the error (line 89), try changing "objectid" to "OBJECTID"
Hello James,
Is it possible to extract photos from the Survey123 SQLite database?
Yigal
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
Bump to Please consider opening up the file system in iOS so that we can backup while offline.
Please - we really, really need it. Works in Collector. Thanks
https://community.esri.com/thread/247270-backups-while-offline-on-ios
Hi Seth,
I'm getting this error, any ideas?
** <out_info_file> Record length 4168 exceed max record length of 4096 bytes **ERROR 999999: Error executing function.Failed to execute (AddField).
Thanks for the script though! Got me farther than before!
FYI I've got field names longer than 16 characters so I'm already taking care of that by [0:16]. This got me past the first error of invalid field names.
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.
Hi @JamesTedrick , I would like to utilize this script to extract data> I have copied the "my surveys" folder onto windows but I don't know how to point to the database and also to specify the output csv file.
Kindly advise how I parse-in the database and the output directories.
Thanks,
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.