Hello all,
I have a hosted feature layer that has 16 layers within it. I want to delete the first layer but I would like to avoid having to delete the whole service and republishing from ArcMap because this layer is live and there are edits being made on it. I would have to download the data in fgb and then repath that data in my ArcMap mxd and then republish. Then I would probably have to recreate the web map and the web app because I have had problems in the past of my existing web maps and apps reading any changes to my feature layers.
What about this blog and PDF referenced in blog? https://blogs.esri.com/esri/arcgis/2014/10/19/updating-hosted-feature-services-in-arcgis-online/
PDF referenced in blog: https://blogs.esri.com/esri/arcgis/files/2014/10/How-to-Update-Hosted-Feature-Service-Schemas1.pdf
In the service URL of the layer I want to delete I see, "Delete from Definition". But does that just delete a few fields in that layer and not the layer itself?
Does anyone have any ideas?
Thank you.
Is there a solution for this? Still do not see a way to delete a single layer within a Feature Service on ArcMap online.
Hello Andrea,
I hope this finds you well!
Unfortunately, there isn't a way to get rid of one or more layers within a Hosted Feature Service without deleting and republishing the service OR using ArcGIS Online Assistant (ArcGIS Online Assistant). If you wish to use ArcGIS Online Assistant, I would recommend making a copy of the service before you make any changes. You should proceed with caution using this workflow, as if its not done correctly, problems may occur with the service.
Below is the workflow for using ArcGIS Online Assistant:
I know it's a long one, but if you wish to take on this specific workflow, I've recorded myself performing the workflow. You can access the video here: https://www.screencast.com/t/QlDosHbdNJ
Cheers,
Joe
Hope this isn't a silly question, but how am I supposed to make a copy of the service? I can save as a new map, but how do I create a copy of the service?
Hi Joe, thanks for this solution, it seems to work well and not too complex.
But I have a problem : some of my hosted feature layers have this "Data" section, but for others this section doesn't exist at all or is empty ! And obviously the hosted feature service from which I want to delete a layer doesn't have this "Data" section 😞
How can I access this "Data" section ?
Regards
Alain
@JoeCatanzarita1 and @AlainChouinard Did you find a way to see the data section? I am having the same problem.
Hi Jen,
No I didn't... Finaly I renamed this layer as xxx_Old and is still in the Feature Layer.
Alain
Hi Joe,
Thanks for this! I just have one question. After removing the layer from the JSON, should the subsequent layers be renumbered? I.e. if I remove "id": 3, should "id": 4 become 3?
Thanks in advance
Matt
Recently, the URL scheme of AGOL has changed to: https:/<your org>.maps.arcgis.com/home/item.html?id=<itemid> &sublayer=<your sublayer> &view=service (which is great because they now include de service id).
but the workflow still works. However, don't forget to delete the "," from the layer above the deleted layer if that is the last one.
You are trying to delete a layer inside a feature service, correct?
I have done this multiple times with the deleteFromDefinition endpoint of the REST API.
You can write a json similar to this on the html page if you are not familiar with API calls.
{
"layers": [{"id": 7}] // layer id
}