Skip To Content

Append Data

Summary

Appends features to an existing hosted feature layer.

Illustration

Append Data workflow diagram
Append Data workflow

Usage

  • The Input Layer must be an existing hosted point, line, area, or table layer. To append to a different layer, you must create a hosted layer of that dataset first. To do this, use the Copy To Data Store tool, or share a layer to your portal. To learn more about sharing layers, see Introduction to sharing web layers.

  • The Append Layer can be a point, line, area, or tabular big data file share dataset or feature layer.

  • The Append Layer must have the same geometry type as the Input Layer. For example, append table features to table features, and point features to point features. No features will be appended if the geometry types are not the same.

  • The fields, geometry, and time of the Input Layer will not be modified.

  • The following two methods can be used to append features:

    • Append matching fields only—Only fields with matching names and types will be appended. This is the default behavior.
    • Append matching fields and resolve differences—Use the Append Fields or Append Expressions parameter to match fields with different names or to calculate values for specified fields.

      Learn more about Append Data expressions

  • Any Append Layer fields that are not matched in the Append Fields or Append Expressions parameter will be excluded from the appended results.

    For example, human migration researchers want to append datasets with the input layer and append layer schemas seen below. Both layers have a field in common, named Country of type text, and both have two additional fields with the same data type, but unique names. The input layer has the fields Pop_ and Pop_Density, and the append layer has Population and area_km2 fields. The researchers want to match the Country field to the Country field, append the Population field to the Pop_ field, and calculate the population density for the Pop_Density field using a mathematical calculation.

    Example input layer and append layer schema
    Input layer and append layer example schemas to be used in the Append Data tool

    By default, Append Data will match Country fields because they have the same field name and field type. By default, fields Pop_ and Pop_Density have no match in the append layer and will be appended with null values.

    Example default field mapping
    Default field mapping that will be applied when the Append matching fields only option is selected for the Append Method.

    Select the Append Method option of Append matching fields and resolve differences to define your own field mapping specifications. Use the Append Fields parameter to append the Input Field Pop_ with values from the Append Field Population. Use the Append Expressions parameter to calculate Pop_Density values for the appending features using the append layer fields Population and area_km2 by building the following Arcade expression: $feature["Population"]/$feature["area_km2"].

    Example defined field mapping
    Defined field mapping as specified in the Append Fields and Append Expressions parameters.

  • This geoprocessing tool is powered by ArcGIS GeoAnalytics Server. Analysis is completed on your GeoAnalytics Server and results are stored in your content in ArcGIS Enterprise.

  • This geoprocessing tool is available with ArcGIS Enterprise 10.6.1.

  • It is recommended that you use feature layers hosted on your ArcGIS Enterprise portal or use a big data file share data when running GeoAnalytics Tools in ArcGIS Pro. Other data sources may perform slowly when there are more than 1000 features.

    Learn more about sharing data to your portal

    Learn more about creating a big data file share through Server Manager

Syntax

AppendData_geoanalytics (input_layer, append_layer, {append_method}, {append_fields}, {append_expressions})
ParameterExplanationData Type
input_layer

The hosted feature layer to which features will be appended.

Record Set
append_layer

The layer containing features to append to the input layer.

Record Set
append_method
(Optional)

Specifies how fields from the Input Layer will be appended with values from the Append Layer.

  • MATCHING_ONLYInput layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.
  • FIELD_MAPPINGInput layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.
String
append_fields
[append_fields,...]
(Optional)

The append layer fields of the same type and different name as the input layer fields to be appended. Select the Input Field you want to append to, and the Append Field containing the values you want to append.

Value Table
append_expressions
[append_expressions,...]
(Optional)

The Arcade expression used to calculate field values for the input field. Expressions are written in Arcade and can include mathematical operators and multiple fields.

Value Table

Code sample

AppendData example (stand-alone script)

The following stand-alone script demonstrates how to use the AppendData tool.

#-------------------------------------------------------------------------------
# Name: AppendData.py
# Description: Append February 2018 sales records to your ANNUAL_SALES2018 hosted layer.
#              
#				Caution: AppendData updates your ANNUAL_SALES2018 layer with appended features.

# Requirements: ArcGIS GeoAnalytics Server

# Import system modules
import arcpy

# Set local variables
inputLayer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ANNUAL_SALES2018/FeatureServer/0"
appendLayer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DataStoreCatalogs/bigDataFileShares_sales2018/BigDataCatalogServer/FEBRUARY_SALES2018"
appendMethod = "FIELD_MAPPING"
fieldMapping = "Pop_ Population;State_ StateName", 
expressionMapping = "Pop_density $feature.Population/$feature.area_km2;Unused_field null"

# Execute Append Data
arcpy.geoanalytics.AppendData(inputLayer, appendLayer, appendMethod, fieldMapping, expressionMapping)

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS GeoAnalytics Server
  • ArcGIS Desktop Standard: Requires ArcGIS GeoAnalytics Server
  • ArcGIS Desktop Advanced: Requires ArcGIS GeoAnalytics Server

Related topics