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.
The 'Hosted Feature Service' is where you enter the service endpoint.
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,
I much not have things setup properly....very confused.
What version of ArcMap do you have? pytz is included with 10.4.
10.3...I guess I could upgrade
EDIT: I will upgrade and try again
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: ''
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)
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()
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.
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.