Select to view content in your preferred language

Store Survey 123 Table in local SDE

9585
52
11-02-2016 01:39 PM
jaykapalczynski
Honored Contributor

I created a collection in Survey 123 but when it publishes it stores the table and attachements in ArcGIS Online. This is not much of an issues other than the fact that I need to Join this table to data that is on my local SDE environment. I cant seem to figure that part out.

  1. Can I create a Relationship Class to a table created from Survey 123 that resides in ArcGIS online to a local Feature Class in my local servers SDE.
  2. Can I move the location of the table and Attachments created by Survey123 to my local SDE Server?
    1. Is there some sort of setting that forces the creation of tables etc to my server not ArcGIS Online?
    2. Set a workspace to my server instead of ArcGIS online????
  3. Can I create a Relationship class in ArcGIS online that relates the table created in Survey123 (located in AGO) to a feature class on my local server?
52 Replies
jaykapalczynski
Honored Contributor

In the attachment table I have this

ATTACHMENTID, REL_GLOBALID, CONTENT_TYPE, ATT_NAME, DATA_SIZE, DATA, GLOBALID

0 Kudos
JamesTedrick
Esri Esteemed Contributor

I was expecting rowid in the feature class, not the attachment table.  Can you compare the field listing at the feature service endpoint against the list of fields created in the table?

0 Kudos
jaykapalczynski
Honored Contributor

Only differences I can see.  No rowID in the Feature Class

SDE FC                                   AGO

OBJECTID                              objectid

SYS_TRANSFER_DATE

0 Kudos
jaykapalczynski
Honored Contributor

Does this error point to line 556? ugggg

Creating Feature Classes & Tables
-Created BR_Boat_Ramp_Inspection_2
-Creating Relationships
-Adding records
-Finding Attachments
-Boat_Ramp_Inspection_2 > BR_Boat_Ramp_Inspection_2
-Field Map
-Boat_Ramp_Inspection_2
-Adding attachments
======================
FAIL: Updating Tables
exception:
A column was specified that does not exist.
['A column was specified that does not exist.']
<type 'exceptions.RuntimeError'>
556
----------------------
arcpy messages:
======================
Failed script SyncData...

0 Kudos
jaykapalczynski
Honored Contributor

This is what is created via the script until the error (See attachment)...It creates the FC and Attachment table.  The FC Table has all the records (I remove all but one), while the attachment table has nothing but the fields.  NO data was written to the Attachment table.

There is NO 'rowid' field...nothing looks out of the ordinary....very confused here....still getting the error in my previous post.

Any help would be greatly appreciated...

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Okay, it looks like a field that is created when a repeat is in the survey isn't created when the survey doesn't have a repeat.  I'll need to modify the script to catch that and create a rowid field, as it's needed to ensure the photo data can be synced.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

As it turns out, that part is already in the code, just set up for repeats, not parent forms.  Around line 243 of the python file, there is:

if 'parentrowid' in originFieldNames and 'rowid' not in originFieldNames:

Change that to:

if 'rowid' not in originFieldNames:

0 Kudos
jaykapalczynski
Honored Contributor

It was looking good then this....ugg...I thank you very much for taking the time to help with this.  Getting closer

  • The rowid exists in the FC
  • The images records are in the attachment table.

Not sure what this error is referring to?

          -Creating Feature Classes & Tables
               -Created BR_Boat_Ramp_Inspection_2
          -Creating Relationships
     -Adding records
     -Finding Attachments
          -Boat_Ramp_Inspection_2 > BR_Boat_Ramp_Inspection_2
          -Field Map
          -Boat_Ramp_Inspection_2
               -Adding attachments
Failed script SyncData...

Traceback (most recent call last):
  File "C:\Users\adminjk\Desktop\PythonSync\SyncBoatRamps.py", line 588, in <module>
    main()
  File "C:\Users\adminjk\Desktop\PythonSync\SyncBoatRamps.py", line 583, in main
    arcpy.SetParameterAsText(7, sde_conn)
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\__init__.py", line 670, in SetParameterAsText
    return gp.setParameterAsText(index, text)
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\geoprocessing\_base.py", line 231, in setParameterAsText
    self._gp.SetParameterAsText(*gp_fixargs(args, True)))
RuntimeError: Object: Error in setting parameter as text

Failed to execute (SyncData).
Failed at Wed Nov 09 10:16:17 2016 (Elapsed Time: 2 minutes 9 seconds)
0 Kudos
jaykapalczynski
Honored Contributor

Everything seems to be ok but am still getting the error above...not sure why.  I get the FC and the attachments records and the relationship class.  I was able to see the records and images in ArcDesktop.  

What does the above error have to deal with?  Thoughts?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Jay,

Apologies for being less responsive - I've been tied down with other tasks.  I'm going to do some testing with the script  and get back to you on this tomorrow.

0 Kudos