Overwrite a hosted feature layer with views in Pro when the parent hosted feature layer is published from a file in ArcGIS Pro

3731
18
01-06-2022 02:21 AM
Status: Needs Clarification
Labels (1)
ZoeBroek
Occasional Contributor

When creating a hosted feature layer view the following is stated:
You can overwrite the hosted feature layer from which the view was created to refresh the data only if the following are true:
- The parent hosted feature layer was published from a file in ArcGIS Online, not from ArcGIS Pro or ArcMap.
- The hosted feature layer view was not generated by the Join Features analysis tool.
- You did not define an area of interest on the view.

The first point needs to be looked at. At the moment you can't publish a layer from Pro, make views from the hosted feature layer in ArcGISOnline and then use Pro again to overwrite the hosted feature layer to refresh the data of the parent hosted FL.
When using the overwrite web layer tool in ArcGIS Pro it tries to delete all the related service items. Which it can't because there are views created from the parent layer.
StatusMessage: Server Response: ERROR: code:400, Unable to delete item. This service item has a related Service item, Bad syntax in request.

However you CAN publish from a FGDB (or any other file) in Online or use FME to publish. It really stuns me that you can't use ArcGIS Pro for this.
So please take it into consideration to fix this!

Kind regards,

Zoë

 

18 Comments
jcarlson

When you publish from Pro, the application creates a service definition item in AGOL. In order to overwrite a hosted layer, the original source file needs to be re-uploaded in the same format as before, whether it be a shapefile, FGDB, or service definition.

The inverse of the situation you describe is also not possible. If you publish a layer from Pro, you will be unable to overwrite that with any file-based source like shapefiles, etc.

ZoeBroek

Thank you for your response. I hear what you're saying, it needs to be re-uploaded in the same format and it isn't possible to overwrite with any kind of file-base source no matter how you overwrite it (FME, Pro or in AGOL). Right? 

However I want to be able to overwrite my hosted feature layer in (if necessary) the same format and through ArcGIS Pro. 

 

KaraUtter

I am having an issue with this as well. I'm not understanding why we can't have views published and overwrite the layers in the same manner we published them in. It makes for a very non-streamlined approach when needing to completely overwrite something when the append/update process won't work. This means we have to actually delete all of our views on a layer to update completely and then recreate them. Very terrible workflow.

TomNeer

This is a major flaw of the "tight" integration of ArcGIS Pro with Portal for ArcGIS.

The only simple way to change the symbology of a Hosted Feature Layer is through the items "Visualization" tab. However, this is Visualization interface is based on the ArcGIS API for JavaScript 3.x which is currently planned to reach end-of-life next year.

The only path I see right now is to create a map in the new Map Viewer. Crack open the map in AGOL Assistant, extract the Renderer object, open the Item in AGOL Assistant and insert the Renderer object. Optionally, you could go through the ArcGIS Server Admin interface and do this too. 

Could we pass on Migrating from 3.x to 4.22 | Overview | ArcGIS API for JavaScript 4.23 | ArcGIS Developer to the Portal for ArcGIS developers? 

This is a major design flaw of using Hosted Feature Layers in Portal for ArcGIS.

EmikoCondeso

I agree this is very problematic--and not an easy problem to find.  I have been updating my hosted feature layer from ArcPro (that has an associated view) for a year.  I recently made a new view tied to this feature layer that was set up for offline use, and that's when my most recent update to the parent layer from ArcPro gave me the error (ERROR: code:400, Unable to delete item).  

This is a big problem for those of us who manage layers in Pro and need to push updates to AGOL. 

ZoeBroek

Hi all, 

I found something that might be a workaround for this problem we all stumbled upon.

Swap the source of a hosted feature layer view—ArcGIS Online Help | Documentation

I haven't tried it yet, but with this you can update your hosted layer and your views as you wish. Not directly from Pro and you have to update each view, but atleast you can update your domains, fields and  data (I think). 

Please share your experience if you've tried!  

Esad
by

I removed the view from ArcGIS Online but I still cannot overwrite the service. I do not see any views on ArcGIS Pro. Does anybody have any solution?

KaraUtter

Maybe append data to layers to edit the feature layer instead of overwriting? This does not mean append in the typical definition that we are used to - here is the documentation for reference:

Manage hosted feature layers—ArcGIS Online Help | Documentation

Esad
by

Thanks for the workaround, Kara. It works fine that way yes, however, I had python scripts that run daily to update map services. And each map service has multiple layers. I am not sure if this append data is available through REST or Python API. I will be searching for those and again thanks.

KaraUtter

@Esad You're welcome. Hopefully you can figure it out! Actually, hopefully ESRI develops a way for us to overwrite hosted feature services that have views associated. That would be the most efficient and streamlined solution.