Is OBJECTID always the attribute name for OBJECTID field in Identify results?

2781
0
04-16-2015 08:28 AM
ericliprandi
New Contributor III

We ran into an issue recently with an alias on the OBJECTID field of one of our layers. We perform an Identify query (ArcGIS REST API​) and parse the results. We had noticed that the attributes keys were field aliases when we first build our app. However it seems to not apply to the OBJECTID field.

Here is the response we got for one of our queries:

{
  "results" : [{
  "layerId" : 7,
  "layerName" : "SplicePoint",
  "displayFieldName" : "SPLICEENCLOSURETYPE",
  "value" : "FiberDome",
  "attributes" : {
  "OBJECTID" : "21",
  "ANCILLARYROLE" : "Null",
  "ENABLED" : "True",
  "EnclosureType" : "FiberDome",
  "Owner" : "GlobalNet Description",
  "SPLICEENCLOSUREMANUFACTURER" : "Null",
  "SPLICEENCLOSUREMODELNUMBER" : "Null",
  "InstalledBy" : "Fiber Pros",
  "DATEINSTALLED" : "3/3/2009",
  "Location" : "Handhole",
  "Description" : "EnviroNet Splice",
  "GROUNDINGMETHOD" : "Unknown",
  "COMMENTS" : "Null",
  "SymbolRotation" : "270.463293",
  "STRUCTUREOBJECTID" : "307",
  "CREATIONUSER" : "Administrator",
  "CREATIONDATE" : "8/25/2009",
  "LASTUSER" : "Administrator",
  "DATEMODIFIED" : "2/10/2010",
  "GlobalID" : "{1605FF76-2F4D-43A8-B63D-DE72D70353CA}",
  "FIBERPARENT" : "Null",
  "THISFIBERCLASSMODELNAME" : "SPLICEPOINT",
  "FIBERPARENTCLASSMODELNAME" : "Null",
  "FIBERCHILDCLASSMODELNAME" : "Null",
  "AerialUnderground" : "Underground",
  "POLEOID" : "Null",
  "SubtypeCD" : "UG Splice Case",
  "Shape" : "Point"
  },
  "geometryType" : "esriGeometryPoint",
  "geometry" : {/*removed for brevity */
  }
  }
  ]
}

And here is the layer info returned from the same service (see attachments for the complete listing):

"fields" : [{
          "name" : "OBJECTID",
          "type" : "esriFieldTypeOID",
          "alias" : "OID",
          "domain" : null
     }, {
          "name" : "ANCILLARYROLE",
          "type" : "esriFieldTypeSmallInteger",
          "alias" : "ANCILLARYROLE",
          "domain" : null
     }, {
          "name" : "ENABLED",
          "type" : "esriFieldTypeSmallInteger",
          "alias" : "ENABLED",
          "domain" : {
               "type" : "codedValue",
               "name" : "EnabledDomain",
               "codedValues" : [{
                         "name" : "False",
                         "code" : 0
                    }, {
                         "name" : "True",
                         "code" : 1
                    }
               ]
          }
     }, {
          "name" : "SPLICEENCLOSURETYPE",
          "type" : "esriFieldTypeString",
          "alias" : "EnclosureType",
          "length" : 50,
          "domain" : {
               "type" : "codedValue",
               "name" : "Fiber Splice Hardware Type",
               "codedValues" : [{
                         "name" : "FiberDome",
                         "code" : "FiberDome"
                    }, {
                         "name" : "Splice Case",
                         "code" : "Splice Case"
                    }, {
                         "name" : "Unknown",
                         "code" : "Unknown"
                    }
               ]
          }
     }

As you can see, even though OBJECTID has an alias (OID), it is returned as OBJECTID. However, SPLICEENCLOSURETYPE is returned as EnclosureType (the alias). This seems to be pretty intentional.

"fields" : [{ "name" : "OBJECTID", "type" : "esriFieldTypeOID", "alias" : "OID", "domain" : null }, { "name" : "ANCILLARYROLE", "type" : "esriFieldTypeSmallInteger", "alias" : "ANCILLARYROLE", "domain" : null }, { "name" : "ENABLED", "type" : "esriFieldTypeSmallInteger", "alias" : "ENABLED", "domain" : { "type" : "codedValue", "name" : "EnabledDomain", "codedValues" : [{ "name" : "False", "code" : 0 }, { "name" : "True", "code" : 1 } ] } }, { "name" : "SPLICEENCLOSURETYPE", "type" : "esriFieldTypeString", "alias" : "EnclosureType", "length" : 50, "domain" : { "type" : "codedValue", "name" : "Fiber Splice Hardware Type", "codedValues" : [{ "name" : "FiberDome", "code" : "FiberDome" }, { "name" : "Splice Case", "code" : "Splice Case" }, { "name" : "Unknown", "code" : "Unknown" } ] } }Where, in the REST API documentation, can we find confirmation of the behavior?

Regards,

Eric.

0 Kudos
0 Replies