Add and update features in a hosted feature layer

Use one of the following to add and update rows, in bulk, in a hosted feature layer or table:

  • Shapefile (zipped)
  • CSV file (.csv)
  • Microsoft Excel file
  • File geodatabase (zipped)
  • GeoJSON file (.geojson)
  • OGC GeoPackage file
  • Another hosted feature layer or table

Uploading an updated file or using another hosted feature layer or table to add rows in bulk allows you to publish initial data, or even an empty hosted feature layer or table, and later append data as it becomes available without having to overwrite the entire hosted layer.

The following are examples of adding features in bulk to a hosted feature layer:

  • If you have a number of employees who do inspections in the field and they gather that information in a .csv file, you can take the file from each inspector at the end of the day and use it to add the new data to the hosted feature layer.
  • If you have a custom app that writes data to a shapefile, you can use the data from the shapefile to add the new data to the hosted feature layer.
  • To duplicate the content of a hosted feature layer, you can create an empty hosted feature layer from the hosted feature layer to duplicate. This copies the schema of the existing hosted feature layer to a new, empty layer. Then use the same source hosted feature layer to add the content to the new layer.

You can also update the values for existing rows using the values in the updated file or other hosted feature layer or table. When you update existing rows, the layer you update and the file or layer you use to load updates must both contain a field of unique values that ArcGIS Online can use to identify the row to update.

Tip:

You can define a field in the sublayer of a hosted feature layer as unique from the Data tab of the layer's item page. Then, when you update the layer, ArcGIS Online can use that field as an identifier.

Considerations when adding and updating features

Be aware of the following when you use a file or another hosted feature layer or table to add or update features:

  • You must ensure that the field values in the file or layer you use for the updates and the field in the layer to be updated correctly and uniquely identify the features to update. If the values do not, you can lose data when an update overwrites attributes for an existing feature. Adding and updating features 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 add or update, you must insert underscores in the field names in the file; otherwise, field names will not be identical.
  • The update operation does not delete features. To delete features using an uploaded file, overwrite the layer.
  • If the hosted feature layer or hosted table is enabled for offline editing, you can only add features or rows; you cannot update them.
  • If you use a hosted feature layer to add or update rows, both the updating and the updated hosted feature layer must exist in the same organization.
  • When you add features or rows that have attachments from a file geodatabase or another hosted feature layer or table, you can include the attachments in the fields added to the existing hosted feature layer or table. Similarly, when you update, new attachments from the source file geodatabase or hosted layer can be added to the corresponding features or rows in the hosted feature layer or table.
  • Updating features does not update existing attachments on the hosted feature layer or table. Only attachments that do not currently exist on the destination feature or row are brought from the source. If the underlying ID of the attachment does not match between the source and destination, the attachment is considered to be new and is added to the destination feature or row.
  • You can add or update big integer, date only, time only, or timestamp offset fields from file geodatabases or from another hosted feature layer or table. To add or update big integer, date only, time only, or timestamp offset fields from GeoJSON, Excel, or .csv files, the field values must meet the following requirements:
    • Integer values that fall outside the range of -2147483648 to 2147483647 will be interpreted as big integers.
    • To be interpreted as date only, values must be in the format YYYY-MM-DD or DD/MM/YYYY.
    • To be interpreted as time only, values must be in the format hh:mm:ss or hh:mm:ss.sss.
    • To be interpreted as timestamp offset, values must be in the format YYYY-MM-DDThh:mm:ss±OffsetFromUTC.

    For examples of date and time values, see Date and time fields in ArcGIS Online.

    If the hosted feature layer or table to be updated does not contain these field types, you can map them to other types, such as a double for big integer fields or a string for date only and timestamp offset fields.

Add and update features in bulk

Complete the following steps to add or update features or rows in a hosted feature layer or table using a file or another hosted feature layer or table:

  1. Sign in to your organization.

    You must be the layer owner or a member of the default administrator role, member of a custom role assigned the set of privileges to manage all content owned by organization members, or a member of a shared update group with which the hosted feature layer is shared.

  2. Open the item page for the hosted feature layer or hosted table.
  3. Click Update data on the hosted feature layer item's Overview tab and choose the source for the updates, either a file or a feature layer.

    Tip:

    You may need to click the Show more button Show more to see all options.

    Alternatively, you can open the Update data window from the Data tab by clicking the Update data button Update data.

    The Update data window appears.

  4. Choose one of the following options and click Next:
    • Add features—Inserts new features from the file to the feature layer or inserts new rows to a table layer.
    • Update features—Uses the values in the file to update attribute values for existing rows in the layer. If the layer is a feature layer, you can also update feature locations.
    • Add and update features—Performs both of the actions described above.

    Note:

    Do not use the object ID field or feature ID (FID) field as the unique identifier when you update features unless you know for certain that no one has deleted features or rows from and added features or rows to the hosted feature layer.

  5. If the hosted feature layer or table contains more than one sublayer, choose the sublayer to add to or update and click Next.
  6. If you are using a file to update or add to the hosted feature layer, use one of the following methods to specify the updated file:
    • Click Your device, browse to and select the file, and click Open.
    • Drag the file from your desktop or File Explorer onto the Update data window.
  7. If the file is a zipped file, choose the file format and click Next.
  8. If you are using a hosted feature layer or table to update or add to the hosted feature layer or table, choose that item from your content or your organization and click Next.
  9. The remaining steps vary depending on the update option you choose, the layer type you're updating, and what type of fields are present in the file or layer you use for the updates.
  10. If you are updating data, define which fields in the layer and the file or layer used to update uniquely identify each feature or row and which can be used to ensure the correct data from the file updates the correct feature or row in the layer.
  11. If the file used for the update contains date values that store time in a time zone other than UTC, choose that time zone from the Time zone selection drop-down menu.
  12. If the source contains attachments, enable the Include attachments toggle button to include new attachments from the source file in the hosted feature layer or table.
  13. Specify which fields in the file, hosted feature layer, or hosted table correspond to which fields in the layer to be updated and click Next.
  14. If you are updating the data in a feature layer, choose one of the following options:
    • Attributes only—Updates nonspatial attribute values only.
    • Geometries and attributes—Updates both spatial and nonspatial values.

    Note:

    If you choose the Add and update features option, added features always contain both attributes and geometries.

  15. If you are adding features or rows only (not updating), click Add and complete to append the features or rows. If you are updating only or updating and adding features or rows, click Update and complete.

    The size of the layer and which options you choose affect the time it takes to apply updates. As soon as this process completes, the updated layer or table is available in maps, scenes, and dependent WFS layers and hosted feature layer views.