HOW TO

Update a hosted feature layer in ArcGIS Online with data from an external feature class

Last Published: July 21, 2023

Summary

A hosted feature layer must be updated with data from an external feature class each time there is new data. For example, an existing hosted feature layer containing data of tree distribution in a forest must be updated with data from an external feature class containing records of the new trees. The Load Data tool can be used to load the new data from the external feature class to the existing hosted feature layer, provided the hosted feature layer and the external feature class have the same field schema and both contain a Global ID field.

This article provides the workflow to update a hosted feature layer in ArcGIS Online with data from an external feature class in ArcMap.

Procedure

The hosted feature layer's attributes in ArcGIS Online (image show below) must be updated with new data from the external feature class. The existing hosted feature layer contains 19 point features representing the distribution of trees within the area.

The attributes field of a hosted feature layer before being updated with data from an external feature class.
  1. In ArcMap, add Global IDs to the external feature class containing the data to load to the hosted feature layer using the Add Global IDs tool.
Note:
Global IDs can also be added from ArcCatalog by right-clicking the feature class and navigating to Manage > Add Global IDs.
  1. In the ArcToolbox window, navigate to Data Management Tools > Distributed Geodatabase > Add Global IDs.
  2. In the Add Global IDs dialog box, select the feature class for Input Datasets.
  3. Click OK.
  1. Create an empty feature class with the same field schema as the external feature class. When defining the fields of the new feature class, click the Import button, and browse for the external feature class to import the field schema to the new feature class. Refer to ArcMap: Create a feature class in a database in ArcMap for more information.
The Import function to import the field schema from an existing feature class
  1. Publish the new empty feature class to ArcGIS Online as a hosted feature layer. Refer to ArcMap: Publish to ArcGIS Online and ArcGIS Enterprise for the instructions to publish hosted feature layers from ArcMap.
Note: 
When publishing the feature layer, ensure the Create, Delete, and Update capabilities are enabled to allow the creation of a local copy of the feature layer in a later step.
  1. In a new map document, add the published empty feature layer to ArcMap.
    1. Sign in to ArcGIS Online by clicking File > Sign In on the ArcMap main menu.
    2. In the Catalog window, expand My Hosted Services.
    3. Select the published feature layer, and drag the feature layer to the Table Of Contents window.
  2. Create a local copy of the feature layer to make edits on the local file geodatabase copy of the feature layer. With the Table of Contents in List by Drawing Order, right-click the group layer containing the feature layer and navigate to Edit Features > Create Local Copy for Editing.
The Create Local Copy for Editing option.
  1. Load the data from the external feature class to the local copy of the feature layer created in Step 5.
Note: 
It is essential to run the Load Data operation in the same ArcMap session. Closing ArcMap to complete the steps later might require repeating the workflow from the beginning.
  1. In the Catalog window, browse for the local copy of the feature layer. The local copy is stored by default in Documents > ArcGIS > FeatureServiceLocalEdits. The path for the local copy is available in the Table Of Contents window when selecting the List By Source mode.
  2. Right-click the feature class in the local copy, and navigate to Load > Load Data to update the local copy using the Simple Data Loader wizard.
  1. Click the Refresh button to view the edits in the data frame.
  2. To sync the edits made to the feature layer with the existing hosted service, right-click the updated group layer containing the feature layer in the Table of Contents, and navigate to Edit Features > Synchronize Local Edits with Server.

The attributes of the hosted feature layer have been updated with data from an external feature class, as shown below. The number of features in the hosted feature layer is now 30.

The attributes of the updated hosted feature layer containing the attributes of the added features.

Article ID: 000015842

Software:
  • ArcGIS Online

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options