Select to view content in your preferred language

Store Survey 123 Table in local SDE

9322
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
JamesTedrick
Esri Esteemed Contributor

The 'Hosted Feature Service' is where you enter the service endpoint.

0 Kudos
jaykapalczynski
Honored Contributor

trying to run script...I get 

>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
File "C:\Users\tjv35563\Desktop\PythonSync\pytz.py", line 10, in <module>
import pytz, sys, os, os.path
File "C:\Users\tjv35563\Desktop\PythonSync\pytz.py", line 36, in <module>
version=pytz.VERSION,
AttributeError: 'module' object has no attribute 'VERSION'

Trying to install pytz and error out on the line version=pytz.VERSION

setup (
name='pytz',
version=pytz.VERSION,
zip_safe=True,

0 Kudos
jaykapalczynski
Honored Contributor

I much not have things setup properly....very confused.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

What version of ArcMap do you have?  pytz is included with 10.4.

0 Kudos
jaykapalczynski
Honored Contributor

10.3...I guess I could upgrade 

EDIT:  I will upgrade and try again

0 Kudos
jaykapalczynski
Honored Contributor

I upgraded to 10.4. Getting this error...

What are the key areas of the Python Script that I have to modify...still confused on that...

>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
File "C:\Users\tjv36463\Desktop\PythonSync\SyncBoatRamps.py", line 578, in <module>
main()
File "C:\Users\tjv36463\Desktop\PythonSync\SyncBoatRamps.py", line 572, in main
process(sde_conn, prefix, featureService, timezone, portal, username, password)
File "C:\Users\tjv36463\Desktop\PythonSync\SyncBoatRamps.py", line 514, in process
now = getUTCTimestamp(timezone)
File "C:\Users\tjv36463\Desktop\PythonSync\SyncBoatRamps.py", line 47, in getUTCTimestamp
timeZone = pytz.timezone(timezone)
File "C:\Python27\ArcGISx6410.4\lib\site-packages\pytz\__init__.py", line 180, in timezone
raise UnknownTimeZoneError(zone)
UnknownTimeZoneError: ''

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Can you provide the original input parameters? It doesn't look like your time zone was specified - that's used in the synchronization process since times are stored in UTC in ArcGIS Online (it's used it to determine which features have already been synchronized)

0 Kudos
jaykapalczynski
Honored Contributor

Hey James thanks....I think this is where I am getting confused...All I have it the downloaded python script.  I am confused where to set the input parameters etc.  Do I need to run this from a specific location/on a specific server?

The only thing I modified at this point was the TOKEN info in the script

def getToken(vxxxx, password='Dxxxxxx1n', portal_URL = 'https://www.arcgis.com'):
'''Gets a token from ArcGIS Online/Portal with the given username/password'''
arcpy.AddMessage('\t-Getting Token')
if password == None:
password = getpass.getpass()

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Ah.  There are a couple of ways to proceed.

The script's current form is designed to be used as a geoprocessing tool (the toolbox in the repo has the script embedded)

The python script's syntax is 

syncSurvey.py <SDE Connection File> <table prefix text> <Feature Service URL> <time zone> <portal url> <username> <password>

If you wanted to hard code these values into the script, you could do so at the bottom of the script, in the main() function.

A somewhat better alternative is to create a config text file (looks at the tests template.txt) and then modify main() to be:

test(<config name>) 

and then alter the test function with appropriate directory and file name for your config file.

You shouldn't have to modify the getToken function.

0 Kudos
jaykapalczynski
Honored Contributor

OK that makes sense now...I will try and setup as a GP Tool for now and see if I can get it to work...thanks for your patience.

0 Kudos