Problem: Unable to append feature class data from ArcGIS Pro to an ArcGIS Online hosted feature layer
Data from a feature class created in ArcGIS Pro can be appended to an ArcGIS Online hosted feature layer using scripts and geoprocessing tools. In some instances, attempting to append the data to a hosted feature layer fails, and returns the error message:
Error: Object reference not set to an instance of an object.
- There are duplicate field values in the field used as the matching field to append the hosted feature layer.
- The field values in the dataset exceeds the character limit of the matching field of the hosted feature layer.
- The file geodatabase appended in ArcGIS Online is not recognized.
Solution or Workaround
Depending on the cause, use one of the methods provided to resolve the issue.
Identify and isolate the duplicates values in the input dataset
To find and isolate the duplicate field values in the dataset used to append to the hosted feature layer, refer to How To: Identify duplicate or unique values in ArcGIS Pro.
Increase the field length of the input dataset
Increase the number of allowable characters for the target field before appending data. Use the Alter Field tool to set the new maximum number of allowable characters for each field.
Note: This option is only applicable to the TEXT or BLOB field type. If the table is empty, the field length can be increased or decreased. If the table is not empty, the length can only be increased from the current value.
Use the correct file extension for the file geodatabase
- Rename the file geodatabase, and add the .gdb extension.
- Compress the file geodatabase, and use the Append Data to Layer tool in ArcGIS Online to update the existing features in the hosted feature layer. Refer ArcGIS Online: Append data to layers for more information.
- ArcGIS Online: Manage hosted feature layers
- ArcGIS API for Python: Append Features
- ArcGIS Blog: What’s new with hosted feature layers: Getting to know Append Part 1 (December 2017)
Last Published: 3/15/2021
Article ID: 000025195
Software: ArcGIS Pro 2.7.2, 2.7.1, 2.7, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6 ArcGIS Web AppBuilder 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.19, 2.18, 2.17, 2.16, 2.15, 2.14, 2.13, 2.12, 2.11, 2.10, 2.1, 2.0 ArcGIS Online 8.3