Assign layer IDs

In ArcGIS Pro, you can share a map containing multiple layers (and stand-alone tables) as a web layer or service. When you share a web feature layer, map image layer, web tile layer, or map service, the layers in your map become service sublayers. Each sublayer is identified by a unique numeric ID that allows you to work with it or reference it in a web map or application. For example, you can reference a service sublayer by URL: https://<service-url>/<layerID>.

By default, each layer you share is automatically assigned an ID based on its drawing order in the Contents pane, beginning with 0 for the first layer. If you share selected layers from your map, the IDs are based on the sequence of the selected layers, including any group layers they are contained within. As layers are added, removed, or reordered, their IDs change accordingly.

You can manually assign layer IDs that remain static as the map is modified. You can enable this with the Allow assignment of unique numeric IDs for sharing web layers setting in the Map Properties dialog box. After this setting is activated, the ID for each layer becomes visible in Layer Properties dialog box where you can customize them before publishing.

As a best practice, manually assign layer IDs prior to publishing if you intend to overwrite the web layer or service in the future. Otherwise, service sublayer IDs can potentially change when the web layer or service is overwritten, causing disconnects in web applications that reference the service sublayer. Manually assigning IDs to layers in your map can help you avoid having to update service sublayer references in web applications should your map contents change. Before overwriting, review the assigned layer IDs and ensure they match existing service sublayer IDs.

To learn more about overwriting web layers and services, see Overwrite a web feature layer, Overwrite a map image layer, or Overwrite a map service.

Author layers and stand-alone tables with static IDs

To author layers and stand-alone tables with static IDs, follow these steps:

  1. Right-click the map in the Contents pane and click Properties Properties.
  2. On the Map Properties dialog box, on the General tab, check Allow assignment of unique numeric IDs for sharing web layers and click OK.

    Sequential IDs are assigned to each layer and stand-alone table in the map.

  3. Optionally, assign custom IDs to layers and stand-alone tables in the map.
    1. Right-click a layer or stand-alone table in the Contents pane and click Properties Properties.
    2. On the Layer Properties or Standalone Table Properties dialog box, on the General tab, type a custom integer ID in the Layer ID or Table ID text box.

      Tip:

      You should be intentional when assigning IDs, like sequentially numbering your layers in multiples of 10 (10, 20, 30, and so on). This provides space for the addition of future layers. For example, you can add layers between existing layers and assign IDs that are between multiples of 10 (15, 25, 35, and so on).

    3. Repeat the previous two steps for each layer or stand-alone table as necessary.
  4. Share the map as a web feature layer, map image layer, or map service.

    The layers and stand-alone tables in the map have static IDs, eliminating the need to update client applications if the web layer or service is overwritten in the future.