Skip to main content

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 rows in bulk to a hosted feature layer or table:

  • 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

Keep the following in mind when you use a file or another hosted feature layer or table to add or update rows:

  • You must ensure that the field values in the file or item you use for the updates (the source) and the field in the item to be updated (the destination) correctly and uniquely identify the rows to update. If the values do not, you can lose data when an update overwrites attributes for an existing row. Adding and updating rows fails if the update results in 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, ArcGIS Online inserts underscores between words in the field names it creates for the hosted feature layer or table. When you add or update, you must insert underscores in the field names in the source file; otherwise, field names will not be identical.

  • The update operation does not delete rows. To delete rows using an uploaded file, overwrite the hosted feature layer or table.

  • If the hosted feature layer or hosted table is enabled for offline editing, you can only add rows; you cannot update them and you cannot delete existing rows before adding new ones.

  • When the Keep track of changes to the data (add, update, delete features) option is enabled on the hosted feature layer or table, only the Add features option is supported; none of the other options are available.

  • If you use a hosted feature layer or table to add or update rows, both the source and the destination item must exist in the same organization.

  • When you add 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 destination item. Similarly, when you update, new attachments from the source file geodatabase or hosted item can be added to the corresponding rows in the destination item.

  • Updating rows does not update existing attachments in the destination item. Only attachments that do not currently exist on the destination 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 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:

    • To qualify as a big integer, integer values in the source must fall outside the range of -2147483648 to 2147483647.

    • 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 destination item 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 in bulk

To add or update rows in a hosted feature layer or table (the destination item) using a file or another hosted feature layer or table (the source), complete the following steps:

  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 destination item's Overview tab and choose one of the following to define the source:

    • Update from a file

    • Update from a feature layer

    Tip:

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

    The Update data window appears.

  4. Choose one of the following options and click Next:

    • Add features—Inserts new rows from the source to the destination.

    • Update features—Uses the values in the source to update attribute values for existing rows in the destination item. If the destination item is a feature layer, you can also update feature locations.

    • Add and update features—Performs both of the actions described above.

    • Delete existing and add new features—Deletes all existing rows from the destination before inserting new rows from the source.

    Note:

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

  5. If the destination item contains more than one sublayer, choose the sublayer to add to or update, and click Next.

  6. To use a file source, do one of the following to specify the file:

    • Click Your device, browse to and select the file, and click Open.

    • Drag the file from your desktop or File Explorer into the Update data window.

  7. If the file is a zipped file, choose the file format, and click Next.

  8. To use a hosted feature layer or table source, choose that item from your content or your organization, and click Next.

    Note:

    The remaining steps vary depending on the update option you choose, the destination item type, and the type of fields present in the source that you use.

  9. If you are updating data, define which fields in the destination and the source used to update uniquely identify each feature or row and which can be used to ensure that the correct data from the source updates the correct feature or row in the destination.

  10. If the source 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.

  11. If the source contains attachments, optionally turn on the Include attachments toggle button to include new attachments from the source file in the destination.

  12. If you are using an existing feature layer or table for the source, optionally do the following to apply a filter to restrict which features are brought in from the existing feature layer:

    1. Turn on the Filter source data toggle button.

    2. Click Add new.

    3. Define the filter based on attribute values in the source layer.

    4. To apply additional filters, repeat steps b and c.

    For example, to add only those features added by the user, planner1, define a filter that includes features in which the created_by field value is planner1.

  13. Specify which fields in the source correspond to which fields in the destination, and click Next.

  14. If you are updating data and the destination is 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 chose the Add and update features option in step 4 above, added features always contain both attributes and geometries.

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

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