Manage hosted feature layers

You can alter certain settings on a hosted feature (or table) layer, while others are set on individual layers in the hosted feature layer. The following sections describe how the layer owner, or an administrator, can manage the settings for a hosted feature layer and the layers it contains.

Tip:

The following settings apply to anyone who can access your hosted feature layer. Take these into consideration when you share your layer:

  • Enable Sync (required for offline use and collaboration)—Use a hosted feature layer offline or in a collaboration.
  • Allow others to export to different formats—Export data from the hosted feature layer.
  • Enable attachments—Add attachments to features in hosted feature layers.

Also be aware that when you share a hosted feature layer with a shared update group, group members can manage many of the settings on the layer.

Rename layers

You can change the name of hosted feature layer items and layers inside hosted feature layers.

Changing the item name or layer names in a hosted feature layer does not affect the names in any dependent hosted layers or views. Similarly, changing the dependent layer's item name or the names of the layers in the dependent layer does not change the names in the source hosted feature layer.

  1. Sign in to your organization and open the item page for the hosted feature layer. To rename a sublayer, open its item page by clicking the layer name under the Layers list on the Overview tab.
  2. On the Overview tab, click the Edit button next to the item or layer name you want to change.
  3. Type a new name for the layer or item and click Save.

Manage settings for editing

As the owner of a hosted feature layer, or an administrator, you can alter settings on the feature layer that affect who can edit and what edits they can make. Other factors also affect who can edit. See Manage hosted feature layer editing for information about all the settings and factors that affect who can edit a hosted feature layer.

There are two edit settings that use a change log that you can manage by trimming older entries, as described below.

Manage the size of the change log

When you enable the options Enable Sync (required for offline use and collaboration) or Keep track of changes to the data (add, update, delete features) on your hosted feature layer, ArcGIS Online stores information about data changes and offline versions in a change log. This change log grows as changes continue to accumulate. To avoid credit charges associated with a large change log, you can trim it.

For each feature layer that has either of these options enabled, you can specify a number of days' worth of changes to retain. Any changes made or versions taken offline or shared in a collaboration that are older than the number of days you specify will be removed.

Caution:

Do not trim the change log if you have unsynchronized collaborations or offline edits that were shared in a collaboration or taken offline during the time period that will be trimmed from the table. For example, if you shared an editable feature layer in a collaboration 100 days ago, and edits from that collaboration have not been synchronized, you can trim records older than 180 days, but do not trim records older than 30 or 90 days. Similarly, if the feature layer was taken offline for editing 40 days ago and not synchronized, you can trim records older than 90 or 180 days, but do not trim records older than 30 days.

In addition, if the layer participates in an offline map area or areas, consider when the layer's associated download package was last updated. To avoid re-creating your map areas, choose a retention period that includes the date that the download package was last updated. For example, if the download package was updated 38 days ago, do not trim records older than 30 days, because that will prevent the map area from updating and synchronizing when you download it.

If all options that use the log file are disabled—for example, both Enable Sync (required for offline use and collaboration) and Keep track of changes to the data (add, update, delete features) are enabled and you disable both, or you have only Enable Sync (required for offline use and collaboration) and you disable it—all records are removed from the log file.

  1. Open the details page of the hosted feature layer for which you want to manage the change log.
  2. Click the Settings tab.
  3. Scroll to the Feature Layer (Hosted) Settings and click Manage change log.

    The Manage change log window appears.

  4. Use the drop-down list to specify the number of days' worth of logs to retain.

    Log entries that are older than the number of days you specify will be removed from the log.

  5. Click Trim the change log.

Allow data exports

As the owner of a hosted feature layer or an administrator, you can export from any layer to a comma-separated values (.csv) file, Microsoft Excel file, shapefile, file geodatabase feature class, GeoJSON file, feature collection, .kml file, or Open Geospatial Consortium (OGC) GeoPackage file. You can also configure a hosted feature layer to allow others to export data from it when they access the layer in ArcGIS Online.

When users other than the owner or administrator export from a hosted feature layer view that has field or feature definitions applied, the exported file only contains those fields or features that the definition allows. When the owner or administrator exports, the definitions are not applied and the exported file contains all fields and features.

Follow these steps to allow others to export from a hosted feature layer or hosted feature layer view when they access the layer in ArcGIS Online:

  1. Sign in as the owner of the hosted feature layer or hosted feature layer view, or sign in as an administrator.
  2. Open the item page for the layer you want to allow others to export.
  3. Click the Settings tab and scroll to the Feature Layer Settings section.
  4. Click Allow others to export to different formats and click Save.

Now other members of your organization can export from the hosted feature layer.

Note:

This setting does not affect others' ability to export data from the underlying service. Even if you do not enable this export setting on your feature layer, anyone who accesses this layer in other clients—such as ArcGIS Pro or custom apps—can export data from it.

Allow attachments

You can allow editors to attach images and other files to individual features in a layer in a hosted feature layer. This allows you to associate documentation or photos to specific, relevant features. For example, a code compliance officer can attach a photo of the code violation for a specific address point, or a building inspector can include a PDF of a permit for a building feature.

Each hosted feature layer view inherits the attachment setting of the hosted feature layer from which it was created. By default, all view users can see the attachments inherited from the hosted feature layer. To control who has access to these attachments, you can hide the attachments in the hosted feature layer view.

Each file you attach to a feature can be a maximum size of 10 MB. To attach files larger than 10 MB, you can use the Upload Part and Add Attachment operations from ArcGIS REST API to do a multipart upload.

For a list of supported file types you can attach, see Edit tables.

Follow these steps to allow people to attach files to features in a layer in your hosted feature layer:

  1. Enable editing on the hosted feature layer.

    If you do not enable editing, users cannot add attachments to the layer.

  2. While still signed in to your ArcGIS Online account, open the feature layer's details page by clicking the layer on the My Content tab of the content page.
  3. Click the name of the layer in the Layers list on the Overview tab to open its details page.
  4. Click the Enable Attachments toggle button.

Now, when others edit the layer, they can attach files to individual features.

If you decide you no longer want any files to be attached to your layer, open the sublayer's details page and disable the toggle button next to Enable attachments. Be aware, though, that this removes all existing attachments from the layer and prevents people from adding any more attachments.

Hide attachments in views

Hide attachments in hosted feature layer views if a subset of users need access to the feature attributes, but they should not see or do not require access to the attachments.

For example, if the attachment contains sensitive information that only a few organization members should see, share the hosted feature layer with a group that contains those few members. Create a hosted feature layer view from the layer, hide the attachments, and share the view with a larger audience.

Follow these steps to hide attachments on individual layers in a hosted feature layer view:

  1. Open the details page for the hosted feature layer view.
  2. Locate the Layers list on the Overview tab and click the layer that has attachments you want to hide.
  3. Click the Hide attachments toggle button to prevent users of the hosted feature layer view from accessing the attachments on that layer.
  4. Repeat steps 2 and 3 for each layer that has attachments you don't want users to access.

If you decide view users do need access to the attachments for one or more of the layers in the view, click the Show attachments link under the applicable layers on the Overview tab of the hosted feature layer view's details page.

Optimize drawing of complex lines and polygons

If your hosted feature layer includes line or polygon layers that contain a large number of vertices and is often viewed at small or medium scales, you can optimize these layers to improve drawing times in web clients. For example, a good candidate for optimization would be a layer that contains ZIP Code boundaries for a state or large region. You may want to view the ZIP Codes at smaller or medium scales to view all of the ZIP Codes at one time, and you also may want to zoom in to view detailed boundaries at large scales. Optimizing a layer such as this increases performance at smaller and medium scales while maintaining the level of detail at larger scales.

Optimizing layers uses additional storage space, and layers cannot be edited until the layer optimization process completes. The feature storage required for optimized layers will increase; however, performance improvements can be substantial for web clients. If you decide you don't need the improved drawing times, you can disable the optimization. This immediately removes the extra storage (decreases the hosted feature layer size), and you will not incur further costs for the additional storage. You can see the size of the hosted feature layer on the Overview tab of the layer's item page.

Note:

Hosted feature layer views inherit the drawing optimization setting of the hosted feature layer from which they were created; you cannot configure this setting independently on views. To enable drawing optimization on views that contain lines or polygons, change the setting of the hosted feature layer from which you created the view.

If a layer in the hosted feature layer contains a polygon or line feature that includes more than 500,000 vertices, drawing optimization will be enabled by default.

To get an idea of display performance improvements, use the following links to compare the same layer of all county boundaries in the United States. Open the layers in two windows of the same browser, add each to Map Viewer or Map Viewer Classic, zoom in to the layers, and pan around. Although performance will vary by network, you will see that drawing performance is significantly better on the optimized layer.

Without drawing optimization on the layer, the hosted feature layer is 136 MB. After the layer is optimized, the hosted feature layer is 205 MB.

Optimization is most useful for line or polygon layers that include features that contain many vertices.

Keep in mind the following when editing or overwriting optimized layers:

  • If you edit or synchronize edits to the layer while optimization is enabled, the edits are automatically optimized.
  • When the feature layer is editable in the map, the layer is loaded without optimization to ensure the full level of data detail is present for editing.
  • If you don't need to edit the data in a specific map, disable editing for the layer in the web map. This allows you to take advantage of the drawing optimization in your view-only map, but the layer can still be edited as necessary in other maps or apps.
  • Overwriting the layer disables optimization. You'll need to follow the steps below to optimize drawing times on the layer again.

Note:

The basemap on which the feature layer is drawn must use the Web Mercator Auxiliary Sphere projection (such as Esri default basemaps) to see improved drawing times. When the layer is added to basemaps with projections other than Web Mercator Auxiliary Sphere, the layer is loaded without optimization.

Follow these steps to optimize drawing times for a line or polygon layer:

  1. Open the hosted feature layer's details page.
  2. Go to the Settings tab and scroll to the Optimize Layer Drawing section.

    The layers in the hosted feature layer that currently have drawing optimization enabled are listed.

  3. Click Optimize layers.

    The Optimize layer drawing dialog box appears.

  4. Check the box next to the layer you want optimized for drawing and click Update.

    The Optimize layer drawing dialog box closes and the update status is shown on the Settings tab.

    The optimization process can take several minutes. Editing is temporarily unavailable on the layer until optimization completes.

If you later decide a layer isn't being used much and does not require drawing optimization, you can disable it. To disable drawing optimization, repeat steps 1 through 3. In step 4, uncheck the layer for which you want to disable drawing optimization and click Update.

Enable time settings

If you have a hosted feature layer that records different information for the same location based on a date and time, you can enable time settings on layers in a hosted feature layer. Once time settings are configured and you add the hosted feature layer to a map, you can configure time settings on the map and see what happened at a specific time or visualize patterns and trends that emerge as the data changes over time.

Overwrite hosted feature layers

To update the data in hosted feature layers published from a file geodatabase, shapefile, GeoJSON file, Microsoft Excel file, or .csv file, replace the data with data from an updated source file using the Update Data > Overwrite Entire Layer option on the layer's item page. For example, if your hosted feature layer is public and you don't want it to be editable, or if another department regularly sends you data updates in a shapefile, you can overwrite the data in the hosted feature layer. This maintains the URL, layer properties you set on the hosted feature layer's item page, symbology, and pop-up configurations.

When you overwrite the data from a local source file, both the file and hosted feature layer data in ArcGIS Online are replaced with the data from the updated source file. If the source is a shapefile with metadata or a file geodatabase that contains feature classes with metadata, ArcGIS Online adds or replaces the layer-level metadata in the hosted feature layer. If you published the hosted feature layer from a cloud drive, the data stays in the cloud drive but the data in the hosted feature layer is replaced.

You must use the same source file type and schema when you overwrite a hosted feature layer.

If the Overwrite Entire Layer option isn't available, your hosted layer cannot be overwritten due to one of the following conditions:

  • It was published from a client other than the ArcGIS Online website. For example, if you published the hosted feature layer from ArcGIS Pro, overwrite the service from ArcGIS Pro.
    Note:

    When you overwrite hosted feature layers from ArcMap, the service definition originally created with the web layer must exist in your ArcGIS Online organization.

  • It was published from a .csv file prior to March 2014.
  • Synchronization is enabled on the hosted feature layer.
  • It's a hosted feature layer view rather than a primary hosted feature layer. To update the data in both the hosted feature layer view and hosted feature layer from which it was created, overwrite the hosted feature layer and the updates will be reflected in the view.
  • You enabled data change tracking on the layer.
  • You deleted the associated source file.

Caution:

  • If editing is enabled on the hosted feature layer, any edits that were made to the layer data are replaced by the data from the updated source file.
  • If you are overwriting from a local file, the file, field, and feature class names must be the same as they were in the original file you uploaded.
  • The same fields and feature classes (in the case of file geodatabases) must be present in the updated file as were in the original file. For example, if you delete a feature class from the file geodatabase, or add a field to the shapefile or feature class, do not overwrite.
  • If you do overwrite and the fields and feature class names and schemas do not match, the feature layer and web maps that use the feature layer may not function as expected. If the source data schema has changed, or if you want to preserve the edits made through the hosted layer, load the shapefile, file geodatabase, Excel file, or .csv file as a new item and publish a new layer instead.
  • The data source and hosted layer must be owned by the same account. If you change the owner of one, change the owner of the other. If you do not, you can't overwrite the hosted layer.
  • If you used addresses or places to locate features when you first published the layer, overwriting the layer geocodes all the addresses or places in the updated file. This may use credits depending on how your organization is configured. Talk to your ArcGIS Online administrator if you have questions about which service is used to geocode locations in your organization. The locator selected when you initially published the layer is automatically used when overwriting.
  • If you altered the details of individual sublayers, those edits will be lost when you overwrite the hosted feature layer from a file, ArcMap, or ArcGIS Pro.
  • The feature layer will be unavailable to other users for a brief time while the layer is overwritten.

Follow these steps to overwrite a hosted feature layer:

  1. Sign in to the organization as the owner of the hosted feature layer or as an administrator.
  2. Open the item page of the hosted feature layer.
    • If you signed in as the layer owner, click the My Content tab of the contents page and click the hosted feature layer to open the item page.
    • If you signed in as the administrator, click the My Organization's Content tab of the contents page and click the layer name to open the item page.
  3. Click Update Data > Overwrite Entire Layer.
  4. Load the edited data.
    • If the hosted feature layer was published from a local file, click Browse or Choose File (depending on your browser), browse to the location of the source file on disk, and click Overwrite.
    • If the hosted feature layer was published from a file on a cloud drive, sign in to the drive. ArcGIS Online automatically updates the hosted feature layer with content from the source file on the cloud drive.

Append data to layers

As the owner of a hosted feature layer or the organization's administrator, you can append features to a layer in an existing hosted feature layer. This allows you to publish initial data, or even an empty hosted feature layer, and later add more data as it becomes available without having to overwrite the entire hosted feature layer. For example, if you have a number of employees who do inspections in the field and they gather that information in a .csv file or a custom app that writes to a shapefile, you can take the file from each inspector at the end of the day and update the hosted feature layer with the new data.

If the update file contains changes to features that are already published, you can also use the input file to update existing features. This requires that the layer and the file you use to load updates both contain a field of unique values that ArcGIS Online can use to identify the feature to update. You can define a field in the sublayer of a hosted feature layer as unique from the Data tab of the layer's details page. Then, when you update the layer, ArcGIS Online can use that field as an identifier.

Caution:

You must ensure that the field values in the update file and the layer correctly and uniquely identify the feature to update. If the values do not, you can lose data when an update overwrites attributes for an existing feature. Update and append fails if you update results with nonunique values in a field you have identified as unique.

When you publish from a .csv or Microsoft Excel file that has field names with spaces, the field names in the hosted feature layer have underscores inserted between words. When you append, you must insert underscores in the field names in the file; otherwise, field names will not be identical.

You can use the following file formats to append or update data:

  • Shapefile (zipped)
  • File geodatabase (zipped)
  • A CSV file (.csv)—The spatial field must be provided in latitude and longitude coordinates.
  • Microsoft Excel file—The spatial field must be provided in latitude and longitude coordinates.
  • GeoJSON file (.geojson)

If your hosted feature layer is enabled for offline editing, you can only append features; you cannot update features.

Follow these steps to append and update features in a layer in a hosted feature layer:

  1. Sign in to the organization as the owner of the hosted feature layer or as an administrator.
  2. Open the item page of the hosted feature layer.
    • If you signed in as the hosted feature layer owner, click the My Content tab of the contents page and click the hosted feature layer to open the item page. To open the details of a sublayer in the hosted feature layer, click the name of the sublayer in the Layers section of the Overview tab.
    • If you signed in as the administrator, click the My Organization's Content tab of the contents page and click the layer name to open the item page. To open the details of a sublayer in the hosted feature layer, click the name of the sublayer in the Layers section of the Overview tab.
  3. Click Update Data > Append Data to Layer.
    Note:

    You can only add new data to a hosted feature layer that has synchronization or change tracking (Keep track of changes to the data (add, update, delete features)) enabled.

  4. Click Browse or Choose File (depending on your browser) and browse to the location of the source file on disk.
  5. If the file is a zipped file, choose the file format from the Contents drop-down list.
  6. Click Upload and Continue.

    When ArcGIS Online finishes analyzing the input file, the Append Data dialog box appears.

  7. If the hosted feature layer contains multiple layers, choose the layer to which the data will be appended or updated.
  8. If the field names in your input file do not exactly match the fields in the layer, click Show field matching to map the fields from the file to the fields in the layer.

    The append operation drops fields that do not match.

  9. If you are only appending new features to the layer, click Apply Updates.

    ArcGIS Online adds the new features to the layer. They are available in maps, scenes, and dependent WFS layers and hosted feature layer views as soon as updates are applied.

  10. If the input file contains updates you want to apply to existing features in the layer, follow these steps:
    1. Check Update existing features.
    2. Specify the fields in the input file and the layer that ArcGIS Online can use to uniquely identify the features to update.
    3. To update the location of the existing features and nonspatial attributes, check Update geometry for existing features. If you do not check this option, ArcGIS Online updates only the nonspatial attributes in each feature.

      Note:

      If the input file's geometry type (for example, points or lines) is different than that of the hosted feature layer, the only option available will be to update attributes for existing features.

    4. If you want the update to proceed even if the input file contains rows that are not in the layer, check Ignore features without a match.
    5. Click Apply Updates.

    ArcGIS Online adds new features and updates the existing features based on your input. Changes and new features are available in maps, scenes, and dependent WFS layers and hosted feature layer views as soon as updates are applied.

Rebuild the spatial index

Spatial indexes improve the performance of spatial queries, such as drawing features on a map or searching for features. If you or other editors add features to the layer that are outside the initial extent of the layer, the spatial index becomes outdated and you may need to rebuild it. For example, if your hosted feature layer contained features in only one city and you later append data that adds features across the country, you should rebuild the spatial index for that layer.

In general, if you find the layer is drawing more slowly than it used to and you know a large number of features have been added to the layer outside the initial extent, rebuild the spatial index.

Follow these steps to rebuild the spatial index on a layer:

  1. Sign in to the organization as the owner of the hosted feature layer or as an administrator.
  2. Open the layer's details page and click the Settings tab.
  3. Scroll to the Manage Spatial Indexes section and click Rebuild Indexes.
  4. Check the box next to the sublayer for which you want to re-create the spatial index and click Rebuild.

    Note:

    While ArcGIS Online re-creates the spatial index, users of the layer will likely see slower performance. If possible, rebuild spatial indexes when the layer is not in use.

Related topics