I'm trying to update our sde with a hosted feature layer.
What is the best approach for this. I'm aware of the API Python and Arcpy. I'm a little confused on how to start of this script. I have a fair amount of knowledge with arcpy and have created complex scripts with it.
The goal is that this script will run automatically or when ever I want it to. Basically I want to take a hosted feature layer that is a copy of our database and update changes that were captured in the Hosted Feature Layer back to our database.
Do I use the API for Python to connect to the Hosted feature layer or can I use Arcpy for that? Would I use both the arcgis python API and arcpy ?
Any guidance would be appreciated!
ArcGIS Pro's Feature Class to Feature Class tool will download the hosted feature class. You could create a model to download the feature class, truncate the Enterprise Geodatabase feature class, then append the downloaded feature class to the Enterprise Geodatabase feature class.
Also, here is another tool that will download a hosted feature service that works in ArcGIS Pro and ArcGIS Desktop:
So there's no need to use ArcGIS API for python?
What do you mean by turncate what does this do? does this delete everything in the enterprise database? I don't think that I would want to do this, I really just want to update 1 field.
Also i tried the tool and I can't get it to create a token. We use OKTA to login into our ArcGIS online accounts. I think thats where the problem occurs, because if I make it public it works no problem.
URL is incorrect. Or, Service is secure, please enter username and password.
Completed script DownloadService...
Failed to execute (DownloadService).
Failed at Wed Jun 12 21:31:18 2019 (Elapsed Time: 1.12 seconds)
Any ideas ?
Correct, you won't need to use the ArcGIS API for Python.
Yes, a truncate will delete all features in the feature class. If you want to update a field, you could perform a join to the downloaded feature class and then a Field Calculation to calculate the values over.
The tool I shared won't be able to authenticate with Okta. It will be best to connect to ArcGIS Online in Pro and use the Feature Class to Feature Class tool to download the data.
Yeah I got it to work that way. So to run this script I would have to log into Pro. I couldn't have this script to run automatically, say over night ?
This tool is amazing by the way!
Thanks for the share.
Yes, could update the #Variables at the beginning of the script. Ex:
You can then use Windows Task Scheduler to execute the script. If you can, I would see if you could create an ArcGIS Online built-in account so that you don't have to share the service with Everyone. Then you can share this service to a Group that user is a member of. That way you use these credentials to create the token and download the service.
I ran into this error using your tool. I can't find any info on it on. Do you have any idea whats going on ?
"fs.load(fsURL)": RecordSetObject: Cannot load a table into a FeatureSet.
Hey Jake I've been using your tool for lots of data out there.
However I can across this error now. Do you know why? Do some datasets not allow you to download their data?
Specifally this data https://gis.bisclient.com/maps03/rest/services/RedRiverWeb/MapServer/0