HOW TO
In some instances, hosted feature layer views that become corrupted cannot be fixed or overwritten, which may affect other critical web maps or web apps. To reconfigure these web maps or web apps with a new hosted feature layer view created from a republished hosted feature layer can be time-consuming.
However, it is possible to direct existing layer views to a republished hosted feature layer view while maintaining the references to the existing layer views in the client's apps and maps.
The workflow in this article describes how to achieve this via the layer view's REST endpoint.
Publish the new hosted feature layer to replace the corrupted hosted feature layer with the same spatial reference as the existing layer view.
{ "layers": [{"id": 0 }] }
{ "layers": [ { "adminLayerInfo": { "geometryField": {"name": "Shape"}, "xssTrustedFields": "", "viewLayerDefinition": { "sourceServiceName": "<name_of_service>", "sourceLayerID":0, "sourceLayerFields":"*" } }, "id": 0, "name": "<name_of_layer>", "type": "Feature Layer", "serviceItemId":"<item_ID>", "isView": true, "isUpdatableView": true, "sourceSchemaChangesAllowed": true, "displayField": "", "description": "", "copyrightText": "", "defaultVisibility": true }] }
Note: For hosted table views, modify the following parameters in the JSON: • geometryField: null • type: "Table"
Note: The new hosted feature layer must have the same spatial reference as the existing layer view. This process may fail if a different spatial reference is used. For more information, refer to ArcGIS Pro: An overview of spatial references.
Get help from ArcGIS experts
Download the Esri Support App