Select to view content in your preferred language

Download survey from device after upload failed

8192
25
10-03-2016 04:39 AM
Nicole_Ueberschär
Esri Regular Contributor

I thought I had seen this question somewhere before but now I can't find it (neither an answer)...

After the upload of a survey failed with the error "code 1003, Operation rolled back", is there any other option to download the data somehow from the device?

For the error itself I have this thread: https://community.esri.com/message/638532-error-code-1003 

25 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Ian,

I'm guessing that the issue is the lack of 'type' in the record's information (that is from the 'data' column, correct?).  Which version of Survey123 are you using?  You could modify line 38 to remove the 'and "type" in fievlValue.keys()' and remove line 39, and it should work.  I'm not sure I would want to make the modifications in the published code, though.

0 Kudos
DanielMcIlroy
Frequent Contributor

I have a similar question, although we are interested in being able to do a backup of the survey data for teams that are in the field without cellular data connectivity for long periods of time (common in Australia!). I will look into this further and see if the process for recovering data from the mobile device could be followed to make backups.

0 Kudos
Nicole_Ueberschär
Esri Regular Contributor

Hi Dan, 

I think it's in fact a good strategy to back up the sqlite database in the field instead of uploading it straight away. The way it is described here Troubleshoot—Survey123 for ArcGIS | ArcGIS should work for you. 

DanielMcIlroy
Frequent Contributor

That is fantastic, thanks for that Nicole!

At least we know that it can be done now, and we should be able to work something out. I am thinking about building a python too that can do the copy automatically for the user.

0 Kudos
SethPaine1
Occasional Contributor

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

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

AndrewHargreaves2
Deactivated User

THis just saved my @$$... thank you Seth Paine‌!

As an FYI - tried setting this up as a script in Pro, but it didn't seem to want to run it. I simply manually entered the parameters in PyScripter and ran it there.

inDB = 'C:/Users/YOU/.../ArcGIS/My Surveys/Databases/a084e6XXXXXXXXe8ec667ca329a63.sqlite'
gdb = 'C:/Users/YOU/AppData/Local/Temp/ArcGISPro4804/afdf1967-XXXXXXXX6139267/Default.gdb'

One downside is that dates get cast back to strings, meaning a lot of manual conversion.

James Tedrick‌ I had to do this as the original completed survey was giving me the #string truncated‌ error. I've since modified my survey to ensure all field lengths are sufficiently long. My plan was to restore the DB and simply republish the troublesome surveys sitting in my OutBox. However it's still giving me the #string truncated‌ error. Bizarrely, I manually recreated the results (minus the photos and location info) and it submitted fine. Can I ask for your advice on how/if I will ever be able to get the surveys sat in my outbox published without having to manually recreate them and thus lose the photos and location info?