I have folks entering data using SURVEY 123. I have someone in the field that collected data using an older form (on a PC) with a different schema. Is there any way to recover the data from the PC and bring it into the new schema (through other steps)? Where is this old data stored?
Any help you can provide is greatly appreciated.
Chris Anderson
Fish and Wildlife Conservation Commission
Hi Chris,
The Survey data is stored in the folder C:\Users\<username>\ArcGIS , in the "My Surveys" and "My Survey Attachments" folders. It is possible to export the data out; this script (GitHub - tedrick/ReadS123DB: Convert the survey data stored in the Survey123 Field App into a set of... ) should be able to help you with exporting so that you can manually append using a field map afterwards.
A couple of questions (sorry of these are very basic):
1. In which directory do I run the script? ArcGIS? My Surveys? My coworker sent me her entire "My Surveys" directory, can I run the tool on it outside of the "My Surveys" in my Users directory?
2. Is this Python script a double-click to run, or do I need to run it in a tool?
Hi Chris,
1. Technically, the script could be run from anywhere. Without modifications, it is designed to be run in the 'My Surveys\Databases' directory, in which you would add a directory called 'out' to store the output. This can be changed by editing lines 4 & 5.
2. In theory, you could double-click it to run (assuming python is installed), though I tend to open a command-line window and run it from there.
Okay. I ran the script as you suggested. Getting an error - TypeError: 'NoneType' object is not iterable.
Can you provide a screenshot of the error?
Okay, I've updated the script to catch the condition when there are no attachements - you can download form GitHub and rerun
Hi James Tedrick,
I'm trying to run this script to help a user recover some surveys and I'm running into the following issue when attempting to run the script -
Traceback (most recent call last):
File "<string>", line 254, in run_nodebug
File "C:\Users\erica.tefft\ArcGIS\My Surveys\Databases\readDb.py", line 132, in <module>
writeCSV(surveys, outDir)
File "C:\Users\erica.tefft\ArcGIS\My Surveys\Databases\readDb.py", line 110, in writeCSV
writer.writerow(row)
File "C:\Python27\ArcGIS10.7\Lib\csv.py", line 152, in writerow
return self.writer.writerow(self._dict_to_list(rowdict))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 27: ordinal not in range(128)
Do you have any suggestions as to what might be going wrong here?
I am running this in the My Surveys\Databases folder as instructed. Instead of running through cmd, I'm running in PyScripter.
Thanks,
Erica
Hi Erika,
This indicates that some of the data is uses non-English characters; this is a limitation of Python 2.x. Try running the script with the python that comes with ArcGIS Pro (Python 3.x).