- URL:https://<geoanalytics-url>/AppendData
- Version Introduced:10.6.1
Description
The AppendData operation 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 parameters
Parameter | Details |
---|---|
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 a URL to a feature service layer. Filters are not supported for this parameter. REST Examples
|
appendLayer (Required) | The table, point, line, or polygon features to be appended to inputLayer. To append geometry, appendLayer must have the same geometry type and time type as inputLayer. Syntax: As described in Feature input, this parameter can be one of the following:
REST Examples
|
fieldMapping (Required) | Defines how the fields in appendLayer are appended to inputLayer. By default, all appendLayer fields that match inputLayer schemas will be appended; fields that exist in inputLayer but not in appendLayer will be appended with null values; and fields that exist in appendLayer but not in inputLayer will not be appended. Optionally, you can choose how inputLayer fields will be appended through the following operations:
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.
This example appends STARTDATE to DATE, appends myTimeField with TIME and calculates the average of sum_week1 plus sum_week2 for the field avg_value.
|
context (Optional) | The context parameter contains additional settings that affect task execution. For this task, there are two settings:
|
f | The response format. The default response format is html. Values: html | json |
Example usage
Below is a sample request URL for AppendData:
https://webadaptor.domain.com/server/rest/services/System/GeoAnalyticsTools/GPServer/AppendData/submitJob?inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&appendLayer={"url":"https://myportal.domain.com/server/rest/services/Earthquakes/earthquakeTracker/FeatureServer/0"}&fieldMapping=[{"inputLayerField":"time_elapsed","mappingType":"AppendField","mappingValue":"minutes_elapsed"}&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}&f=json
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"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 Check job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:
https://<analysis url>/AppendData/jobs/<jobId>
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:
https://<analysis-url>/AppendData/jobs/jobId/inputs/inputLayer?token=<your token>&f=json