You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
I have not looked into how the survey 123 configuration is stored. Can you break it down into the items that are required? I know there is a feature service, is there another item you are trying to update? The feature service includes domains, you probably would need to change them to update a picklist
@delfavero - Survey123 Form items are zip files, not XML. Aside form the xForm XML, it may also include CSV files for other choice lists / data lookups, images, audio. (though not necessary, it also includes the xlsx file as well). As it happens, we (the Survey123 team) are working on a script to enable this workflow (we're primarily looking to support CSV replacement, but it should be able to support the XML file as well, so long as it's been properly formatted).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ArcRest 3.5.3
Enhancement
I am working on a script to custom update a Survey123 xml form with updated choices lists from a SQL database.
After modifying the form based on the database, I cannot see a way to simply replace the xml file in AGOL and keep the same FSID.
The attached script adds a new form with the same name to the folder with a new FSID. I am attempting to use AddItem. Should I use UpdateItem?
syncForms3_ReplacePortalXML_py.txt
from arcpy import AddMessage
import os, arcrest
from syncForms1_listFormFSIDs import listFSIDs
formsFolder = r'C:\Users\sdelfavero\ArcGIS\My Survey Designs'
portalURL = 'https://nps.maps.arcgis.com'
fsIDs = listFSIDs(formsFolder)[0]
fsIDs = {'Bear Patrols' : 'e0dd349f25134112af9677c7db38a683'}
creds = {'user' : 'xxx', 'pw' : 'xxx'}
def msg(txt):
print (txt)
AddMessage(txt)
def listXMLs():
XMLs = {}
for pth, dirs, fNames in arcpy.da.Walk(formsFolder):
for fName in fNames:
if fName.endswith('.xml'):
x = os.path.join(pth, fName)
print x
XMLs[fName] = x
return XMLs
def createSecurityHH():
# create security dictionary object
msg('\nCreating Security Handler')
user = creds['user']
pw = creds['pw']
sh = arcrest.AGOLTokenSecurityHandler(username=user,
password=pw,
org_url=portalURL)
return sh
def replaceXML(sh, srv, xml, fsID):
def replaceAllXMLs():
msg('Updating All Forms in ArcGIS Online')
sh = createSecurityHH()
if name == 'main':
replaceAllXMLs()
The text was updated successfully, but these errors were encountered: