Allow overwriting a HFS that has views and sync

04-11-2019 06:59 AM
Status: Open
by Anonymous User
Not applicable

We've published several internal authoritative layers to AGO for our Org's users - parcels with tax info, 911 addresses and centerlines, etc. I was looking forward to creating views from these source hosted feature services for use with different users and groups. After creating numerous views and adding them to maps and apps, I was very frustrated (but honestly not surprised) that I can't overwrite a source hosted feature service from Pro that has views associated with it.

What is the point of creating views if we can't overwrite/update the source/parent HFS used to create the views? And this is still an issue when Sync is enabled too. I used to get a warning saying a HFS couldn't be overwritten if existing "copies" existed because of Sync. Now I'm getting the same warning about views.

Allow AGO users to overwrite a HFS even if it has views associated with it and sync enabled. I'm not sure how else we can get our SDE data (updated daily) out to AGO without this functionality. I'm not turning off sync and deleting views every week so I can simply update a source HFS with our internal SDE data.

Even though we don't use it, from what I've seen in these forums this is also an issue for overwriting HFS through python scripting too.


Have you considered simply appending to the hosted feature layer? I find that having a version field which you use in the feature layer views works well.


Appending does it lend it self when automating the "updating" via Python. 

by Anonymous User

Two issues with append. 1. The help says to use a file geodatabase or shapefile to update a HFS. So in order to append, I would have to take our SDE data, export each layer to its own file geodatabase, zip it, upload it to AGO, and then try to do an append? Everytime? This could work for some things, but having to do these steps everytime doesn't appear to be a long-term solution. And 2. On some of our layers we have Sync enabled for people to take layers offline in Collector (even if they aren't editing the layer). I can't update existing features with sync enabled. This creates a whole host of issues to just try and update a layer. I'm not going to have 20+ people have to delete offline maps from iPads so I can disable sync, update a layer, re-enable sync, and have them re-download maps. Everytime. Not a solution.

Having numerous views and sync enabled on layers and then having to go delete and change a ton of things just to update a layer doesn't make any sense. This is where an overwrite, or some kind of update/append, with different settings through Pro would be beneficial. Moreso if we could update/overwrite with views and sync. I could just have our SDE layers in Pro already and do this in one or two easy steps. Just seems to be too many strings attached to too many things in AGO.


BUG-000116407 Hosted Feature Service Settings (Export, Sync, and Edit) always set to False (unchecked) when overwriting a service using the CreateWebLayerSDDraft function in the ArcGIS API for Python, which is "In Product Plan", may alleviate the setting override issue, if the fix to the python API also fixes the UI workflow. 


Thanks for the information Nathan.

Would collaboration work for your publishing workflow? I'm wondering if this will be workable to keep your internal and ArcGIS Online data synchronized at a regular interval? You would need to have ArcGIS Enterprise (10.5.1 or above) installed in order to use distributed collaboration. With distributed collaboration, updates from services can be copied to either ArcGIS Online or ArcGIS Enterprise depending on your configuration.

I think there are some details to discuss about how you would then use the copied data in your workflows like where do you create the view (source or recipient)?



Hi Nathan, not sure if you've sorted out this problem by now, but we had this same problem here and deleting features and appending actually ended up working for us. You actually can do this using data from an enterprise geodatabase; you just have to connect to the database through Pro. You can then use the Delete Features tool to delete the records from the layer on AGOL and then append from the layer on your SDE. If you're automating this through Python, if you have a database connection stored on a local drive, you may be able to get the data from the SDE that way. However, in my case, I had to first use Python to export the layers from my SDE to a local geodatabase, and then use the data in the local geodatabase to do the delete/append process with the data on AGOL.

by Anonymous User

Hi. In the last 2 years we ended up deploying enterprise and did a Portal to AGO collaboration, so some of our issues were resolved doing that. I've tried deleting and appending records to various AGO layers over the past year, and it takes way too long. I had a dataset with about 40,000 points and waiting for Pro to delete them in AGO and then Append took hours. This workaround may work for smaller datasets but I wasn't too impressed with trying to do it with large datasets. And then turn around and try to do it weekly after internal data has been updated. I guess I could setup a model or script to run on the weekends but, I haven't had much time to dig into that. Has your process worked with large datasets?

by Anonymous User

I'm interested in this too as we've got a very similar use case. We have a script for weekly updates of our data to ArcGIS Online for use there but also in Open Data (Hub). I was able to overwrite the feature layers with Sync enabled without any problems. However, once users started doing offline maps (Explorer app) that created replicas which prevent overwriting the feature layer.

One of our layers is about 42k points so it sounds like the delete and append isn't going to work. The Collaboration function I'm not convinced about  given the response at the bottom of this thread