Assign features to record

Description

Assigns the specified parcel features to the specified record. If parcel polygons are assigned, the record polygon will be updated to match the cumulative geometry of all the parcels associated to it. The Created By Record or Retired By Record attribute field of the parcel features is updated with the global ID of the assigned record.

Learn more about assigning parcel features to a record

Request parameters

Parameter

Details

gdbVersion

Parameter specifying the name of the geodatabase version (the default is the DEFAULT version).

Syntax

gdbVersion=<version>
sessionId

Parameter representing the token (guid) used to lock the version. If the calling client is editing a named version, the session ID is required. If the specified version is currently locked by any other session, the request will fail if the session ID is not provided or does not match the session ID that holds the exclusive lock. If the client is editing the default version, the session ID is not required.

Syntax

sessionId=<guid>
parcelFeatures

(Required)

Represents the parcel features to assign to the specified record. Can be parcels, parcel polygons, parcel points, and parcel lines.

Syntax

parcelFeatures=[{"id":"<guid>","layerId":"<layerID>"},{...}]
record

(Required)

Represents the record that will be assigned to the specified parcel features.

Syntax

record=<guid>
writeAttribute

(Required)

Represents the record field to update on the parcel features. Either the Created By Record or Retired By Record field is to be updated with the global ID of the assigned record.

Syntax

writeAttribute=CreatedByRecord|RetiredByRecord

Values: CreatedByRecord | RetiredByRecord

f

Representing the output format of the response. The default response format is html.

Values: html | json

JSON Response syntax

{
  "moment": <datetime>,
		"exceededTransferLimit: <true | false>,
 	"serviceEdits": [
    {               // only if transfer limit is not exceeded
		    "id" <layerID>,
      "editedFeatures": {
				    "spatialReference": {<spatialreference>},
						  "updates": [
          {
            "attributes": {...},
            "geometry": {...}
          },
          {...}
        ]
						},
					 {
						  "id": <layerID>,
							 "editedFeatures": {
								  "spatialReference": {<spatialreference>},
										"adds": [
            {
              "attributes": {...},
              "geometry": {...}
            },
            {...}
          ]
        },
        {...}
      }
    }
  ]
  "success": <true | false>,
		"error": {  // only if success is false
		  "extendedCode": <HRESULT>,
				"message": <error message>,
				"details": [<detail>
  }
}

Example usage

This example shows the steps for assigning two tax parcels to the specified record using the assignFeaturesToRecord operation.

NoteNote:
The sessionID parameters must be the same for starting the edit session, performing the edit operation and stopping the edit session.

Steps:
  1. Start a service session on the version.

    Request URL and parameters

    https://machine.domain.com/webadaptor/server/rest/services/CountyFabric/VersionManagementServer/versions/E4DAED9D-C859-489B-9053-767A45F1D97C/startReading
    f=json
    sessionId={b0c18555-6a2d-40fb-a8fe-55bb62450a7c}
    

  2. Start an edit session on the version.

    Request URL and parameters

    https://machine.domain.com/webadaptor/server/rest/services/CountyFabric/VersionManagementServer/versions/E4DAED9D-C859-489B-9053-767A45F1D97C/startEditing
    f=json
    sessionId={b0c18555-6a2d-40fb-a8fe-55bb62450a7c}
    

  3. Assign two tax parcels to the specified record. The parcels are not historic.

    Request URL and parameters

    https://machine.domain.com/webadaptor/server/rest/services/CountyFabric/ParcelFabricServer/assignFeaturesToRecord
    f=json
    gdbVersion=admin.Version1
    sessionId={b0c18555-6a2d-40fb-a8fe-55bb62450a7c}
    parcelFeatures=[{"id":"{B4133CD4-AF3B-4008-8594-59C1C650805D}","layerId":"10"},{"id":"{45CCBD56-0AC8-4D22-A2F3-AA42B77FDD3B}","layerId":"10"}]
    record={78BEE123-4A76-4B6C-9B12-C30786E46B48}
    writeAttribute=CreatedByRecord
    

  4. If edits are complete, stop the edit session.
  5. Stop and release the service session.

JSON Response example

{
	"moment": 1570659946770,
	"exceededTransferLimit": false,
	"serviceEdits": [{
		"id": 10,
		"editedFeatures": {
			"spatialReference": {
				"wkid": 2913,
				"latestWkid": 2913,
				"xyTolerance": 0.0032808398950131233,
				"zTolerance": 0.001,
				"mTolerance": 0.001,
				"falseX": -111333600,
				"falseY": -98152500,
				"xyUnits": 3048,
				"falseZ": -100000,
				"zUnits": 10000,
				"falseM": -100000,
				"mUnits": 10000
			},
			"updates": [
				[{
					"attributes": {
						"OBJECTID": 14,
						"Name": "133_(1)",
						"ParcelSubtype": 1,
						"CreatedByRecord": null,
						"RetiredByRecord": null,
						"StatedArea": 9848.0,
						"StatedAreaUnit": null,
						"CalculatedArea": null,
						"MiscloseRatio": 100000.0,
						"MiscloseDistance": 0.00077059,
						"IsSeed": 0,
						"created_user": "GIS",
						"create_date": 1570125893000,
						"last_edited_user": "GIS",
						"last_edited_date": 1570125893000,
						"GlobalID": "{B4133CD4-AF3B-4008-8594-59C1C650805D}",
						"Shape__Area": 9841.81480272335466,
						"Shape__Length": 401.283389427499685
					},
					"geometry": {
						"hasZ": true,
						"curveRings": [
							[
								[7501279.75853018463, 446279.163385823369, 0],
								[7501276.041010499, 446167.400918632746, 0], {
									"c": [
										[7501265.72309711576, 446157.747703418136, 0],
										[7501272.88087818027, 446160.437852208852]
									]
								},
								[7501195.78379264474, 446160.078083992, 0],
								[7501197.83169291914, 446281.89599737525, 0],
								[7501279.75853018463, 446279.163385823369, 0]
							]
						]
					}
				}, {...},
{
		"id": 2,
		"editedFeatures": {
			"spatialReference": {
				"wkid": 2913,
				"latestWkid": 2913,
				"xyTolerance": 0.0032808398950131233,
				"zTolerance": 0.001,
				"mTolerance": 0.001,
				"falseX": -111333600,
				"falseY": -98152500,
				"xyUnits": 3048,
				"falseZ": -100000,
				"zUnits": 10000,
				"falseM": -100000,
				"mUnits": 10000
			},
			"adds": [{
				"attributes": {
					"ObjectID": 831,
					"IsRetired": 1,
					"GlobalID": "{E32EC5FC-A5C3-401C-8D6A-0AA1D8030CD2}",
					"created_user": "admin",
					"create_date": 1570659946000,
					"last_edited_user": "admin",
					"last_edited_date": 1570659946000,
					"Shape__Area": 10431.25214602294,
					"Shape__Length": 416.362204730510712
				},
				"geometry": {
					"rings": [
						[
							[7501195.77066929638, 446157.72900262475],
							[7501195.77066929638, 446281.909120738506],
							[7501279.77165354788, 446281.909120738506],
							[7501279.77165354788, 446157.72900262475],
							[7501195.77066929638, 446157.72900262475]
						]
					]
				}
			}, {....}
"updates": [
				[{
					"attributes": {
						"OBJECTID": 45,
						"CreatedByRecord": null,
						"RetiredByRecord": null,
						"ParentLineID": null,
						"Direction": null,
						"Distance": null,
						"Radius": null,
						"ArcLength": null,
						"Radius2": null,
						"COGOType": null,
						"IsCOGOGround": null,
						"COGOAccuracy": null,
						"Rotation": null,
						"Scale": null,
						"created_user": "admin",
						"create_date": 1570479614000,
						"last_edited_user": "admin",
						"last_edited_date": 1570479614000,
						"GlobalID": "{07BA8BD0-5145-42CF-9073-A758E012D3C0}",
						"Shape__Length": 120.576780984508773
					},
					"geometry": {
						"hasZ": true,
						"paths": [
							[
								[7501112.875, 446283.507217854261, 0],
								[7501125.89238844812, 446163.635170608759, 0]
							]
						]
					}
				}, {...},
...}]
"success": true