Select to view content in your preferred language

Map rejects hosted feature layer after overwrite

4979
34
Jump to solution
12-21-2022 01:13 PM
Labels (2)
RandyMcGregor3
Occasional Contributor III

I have a hosted feature layer in ArcGIS Online that I need to periodically overwrite. It appears in four maps. When I overwrite it, all layers sourced to this feature layer become disconnected with an error message 'An error occurred loading this layer.' There is nothing wrong with the layer. No fields change. The source GIS layer is the same each time (new features are swapped out for old - and that's when I need to overwrite the layer.). I reload it and reconfigure it when this happens. This is time-consuming. 

Does anyone know what causes this? I overwrite hosted feature layers regularly and this is not a normal occurrence.

Any suggestions would be appreciated. This is very disruptive to an important workflow.

Thank you,

Randy McGregor

1 Solution

Accepted Solutions
MaxwellESRI
New Contributor

Hi @RandyMcGregor3 and @JamesShreeve,

 

After doing some testing, I think I might have found the issue. It seems that when overwriting a web layer inside ArcGIS Pro the layer IDs are sometimes being changed regardless of unique IDs being enabled for all layers in a map project. To correct this issue from within ArcGIS Pro, first validate that "Allow assignment of Unique numeric IDs for sharing web layers" is turned on in map properties > general.

 Enable Unique IDs.PNG

Next, open up the layer properties for the web layers you are looking to overwrite. Under the general tab, validate that the Layer ID matches the Layer ID in the ArcGIS Online Rest Service.

Check_layer_ID.PNGLayer_ID_RestServices.PNG

If they do not match, change the Layer ID in ArcGIS Pro to match that of the Layer ID on ArcGIS Online. Then you should be able to overwrite the layer without breaking any links. Let me know if this resolved the issue and or if you have any more questions. We also offer overwriting hosted feature layers through ArcGIS Online. You can do this by going to the item details page for the layer, and selecting the Update Data > Overwrite Entire Layer. This will only work if the HFL is published on ArcGIS Online. This workflow won't work with ArcGIS Pro derived layers. You can read more about that here Overwrite HFL ArcGIS Online.

Thanks!

Maxwell

View solution in original post

34 Replies
JamesShreeve
New Contributor III

I've noticed this recently too. I swear it didn't happen previously, I work for a local gov organisation and there are plenty of layers which are consumed by multiple maps. As you say @RandyMcGregor3 it's very time consuming to go into each map and re-point, especially if pop-ups/symbology etc. is complex. I use the overwrite tool quite frequently and it would be good to know why the maps online now seem to be struggling to recognise the updated layers.

RandyMcGregor3
Occasional Contributor III

Agree it seems like a new thing. It only affects layers within maps (so far). I have layers populating dashboards that I can overwrite without incident (Thankfully - reconfiguring those would be a nightmare). Like you, I do have complex popups, filtering and symbology which have to be redone from scratch. I have had to write all the parameters down because after the overwrite the layers are100% dead. I cannot get any information from them. 

This is what I see after an overwrite for every incidence of the layer in a map. 😞

RandyMcGregor3_0-1671714912256.png

 

0 Kudos
JamesShreeve
New Contributor III

Yeah I've only noticed it within maps, although I don't have anything concrete in dashboards. Definitely not ideal for users having to re-do all that work when the overwrite function shouldn't (and hasn't previously) act in this way. I also realised I had loads of decorated URLs which linked from our website to individual polygons, which obviously had to be re-done too. 

That's the same error I see on our maps too. I know there are other ways around it e.g. truncate and append in MB, but if the function is there to overwrite then it should work, as it has done before. Hopefully someone sees this post and can offer some feedback!

RandyMcGregor3
Occasional Contributor III

Thanks for the input. Interesting. What does truncate and append in MB refer to? I do a delete append in the the feature class when features are updated then use the updated feature class to overwrite the hosted feature layer (then reconfigure the broken links).

I have wondered about creating layer views with filtering and symbology. I don't know if they would get killed on the overwrite, but if not at least I could (I think) load those in after the overwrite. Either way - YES - It should not be necessary. Awkward because we are on a budget.

0 Kudos
RandyMcGregor3
Occasional Contributor III

When I check the feature layer 'Data' tab, several fields are not visible, including some that are used in filters and labelling. I am trying to make them visible, but it's not sticking. I wonder if this has something to do with it. When I set the ones I need to be visible, it doesn't stick. When I refresh the screen, it reverts to being not visible by default.

RandyMcGregor3_1-1671731939533.png

 

 

 

0 Kudos
JamesShreeve
New Contributor III

Apologies for the slack reply, went on annual leave over the festive period. Truncate and append in ModelBuilder, so I've used that to automate some daily updates to my hosted feature layers. Truncate just removes the whole table and re-populates using the append. Not hugely different to delete append. 

RandyMcGregor3
Occasional Contributor III

You can do a truncate/append directly on an HFL? (A little embarrassed asking this, but...).

0 Kudos
JamesShreeve
New Contributor III

Yeah I didn't realise you could either until I found something on the community pages. So I have created the attached Model which then enables me to run them as a scheduled tool (as I didn't know Python well enough to create a script). The XY table to point is creating a layer from a database of planning applications which then appends into the truncated WFL, as seen on the bottom row. 

0 Kudos
RandyMcGregor3
Occasional Contributor III

Wow. That workflow is amazingly similar to mine, but I do an append/delete, rather than truncate/delete. xy values come from a database and are used to create points that replace current points (then I overwrite the layer as we have been discussing). I will look into a direct update of the HFL, but I do like having the feature class as a back up. Thanks!