Update feature service with ArcGIS api for python

Jump to solution
07-24-2017 10:02 AM
Occasional Contributor II

I am trying to figure out how to update a feature service hosted on arcgis online using the arcgis api for python. Essentially, every morning I would like to run a script that takes new features from a feature class on our organizations egdb and update a replica of the feature service on AGOL. 

Is this possible?

Tags (1)
0 Kudos
15 Replies
New Contributor III

When trying to use the overwrite() function, my code returns the following error:

AttributeError: 'FeatureLayerCollection' object has no attribute 'managers'

My code looks like the following:

gis = GIS(username=username, password=password)
fs = gis.content.get('idoffeatureservice')
flc = FeatureLayerCollection.fromitem(fs)
flc.manager.overwrite("path to feature class inside an FGDB")‍‍‍‍‍‍

Any ideas?

New Contributor II

DId you ever get this script to work?

0 Kudos
Esri Contributor
New Contributor III

Is it possible to pass a SpatialDataFrame as the overwrite parameter?  Thus far it seems that the overwrite() function accepts only local data files...

0 Kudos
Esri Contributor

My new csv that has to add features to the feature service has 65k rows. Is this still a good approach to update them, or should I use another technique?

0 Kudos
New Contributor III

I have similar requirement to update a hosted feature layer in AGOL using scheduled python script.

My source data is stored in an SDE DB. What is the best way to achieve that in 2021?

0 Kudos