Skip to content

Swap ArcGIS Online View Source

There are times when it is just easier to swap the source for a Feature Layer View manually. Doing this manually requires going to the item page, and going to the REST endpoint. From there click on Admin in the top right corner of the page. This will take you to another similar page, with the Supported Operations now including Add to Definition and Delete from Definition. These will be used to first remove the existing reference to the Feature Service, and next, add the new.

Remove Existing

Using the layer index, remove the exiting layer from the Feature Layer View. After clicking on Delete from Definition. On the Delete From Service Definition page, remove and replace the JSON in the window with the following.

{
  "layers": [
    {
      "id": 0
    }
  ]
}

Add New Layer

After successfully removing the layer, next add the new one by going to Add to Definition. On the Add to Service Definition page, replace the JSON with the following, replacing centroids_20250611 with the name of the updated feature service name.

{
  "layers": [
    {
      "adminLayerInfo": {
        "viewLayerDefinition": {
          "sourceServiceName": "centroids_20250611",
          "sourceLayerId": 0,
          "sourceLayerFields": "*"
        },
        "geometryField": {
          "name": "Shape"
        },
        "xssTrustedFields": ""
      }, 
      "id": 0,
      "name": "centroids_20250611"
    }
  ]
}