Append Data

The Append Data task appends tabular, point, line, or polygon data to an existing layer. The input layer must be a hosted feature layer. The tool will add the appended data as rows to the input layer. No new output layer is created.

Request URL

http://<analysis URL>/AppendData/submitJob

Request parameters

ParameterDescription

inputLayer

(Required)

The table, point, line, or polygon feature layer that will have data appended to it.

Syntax: As described in detail in the Feature input topic, this parameter can be the following:

  • A URL to a feature service layer

Filters are not supported for this parameter.

appendLayer

(Required)

The table, point, line, or polygon features to be appended to the inputLayer.

To append geometry, the appendLayer must have the same geometry type as the inputLayer. If the geometry types are not the same, the appendLayer geometry will be removed and all other matching fields will be appended. The geometry of the inputLayer will always be maintained.

Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:

  • A URL to a feature service layer with an optional filter to select specific features
  • A URL to a big data catalog service layer with an optional filter to select specific features
  • A feature collection

REST web example:

  • {"url" : "http://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

REST scripting example:

  • "inputLayer" : {"url": "http://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

fieldMapping

(Required)

Defines how the fields in appendLayer are appended to the inputLayer.

The following are set by default:

  • All appendLayer fields that match inputLayer schema will be appended.
  • Fields that exist in the inputLayer and not in the appendLayer will be appended with null values.
  • Fields that exist in the appendLayer and not in the inputLayer will not be appended.

Optionally choose how inputLayer fields will be appended from the following:

  • AppendField—Matches the inputLayer field with an appendLayer field of a different name. Field types must match.
  • Expression—Calculates values for the resulting field. Values are calculated using Arcade expressions. To assign null values, use 'null'.

REST web example:

  • Syntax: This example appends Average_Sales to Mean_Sales, calculates an expression of WeeklyRate multiplied by 1.5 to append the values for Bonus, and sets a value of null for appended features in Errors.
    [{
        "inputLayerField": "Mean_Sales",
        "appendType": "AppendField",
        "appendTypeValue": "Average_Sales"
    },
    {
        "inputLayerField": "Bonus",
        "appendType": "Expression",
        "appendTypeValue": "$feature["WeeklyRate"] * 1.5 "
    },
    {
        "inputLayerField": "Errors",
        "appendType": "Expression",
        "appendTypeValue": "null"
    }]
  • To append based on default schema matching: []

REST scripting example:

  • Syntax: This example appends STARTDATE to DATE, appends myTimeField with TIME, and calculates the average of sum_week1 plus sum_week2 for the fieldavg_value.
    "fieldMapping": [{
        "inputLayerField": "DATE",
        "appendType": "AppendField",
        "appendTypeValue": "STARTDATE"
    },
    {
        "inputLayerField": "TIME",
        "appendType": "AppendField",
        "appendTypeValue": "myTimeField"
    },
    {
        "inputLayerField": "avg_value",
        "appendType": "Expression",
        "appendTypeValue": "Average($feature["sum_week1"], $feature["sum_week2"])"
    }]
  • To append based on default schema matching:"fieldMapping": []

context

f

The response format. The default response format is html.

Values: html | json

Response

When you submit a request, the service assigns a unique job ID for the transaction.

Syntax:
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}

After the initial request is submitted, you can use jobId to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, use the jobId to retrieve the results. To track the status, you can make a request of the following form:

Access results

When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:

http://<analysis url>/AppendData/jobs/<jobId>/inputs/inputLayer?token=<your token>&f=json