Fields returned in Identify not the same as fields defined in the layer

4248
7
04-27-2010 08:39 AM
NicoleSchmidt
New Contributor III
My map service returns a different field name for identify than is defined in the service. 

http:\\myserver\ArcGIS\rest\services\testservice\MapServer\5 I see a list of fields:
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
L_NUMBER (Type: esriFieldTypeString, Alias: Number)
L_STYPE_CD (Type: esriFieldTypeInteger, Alias: GIS Subtype)
L_ID (Type: esriFieldTypeInteger, Alias: Auto ID)

When I use the identify operation, it returns this as the list:
"attributes" : {
        "OBJECTID" : "540",
        "Number" : "19348",
        "GIS Subtype" : "Null",
        "ID" : "8",

Why is it returning the wrong alias name for the "Auto ID" field (it is returning it as "ID")?

Thanks
0 Kudos
7 Replies
NicoleSchmidt
New Contributor III
I figured it out.  It is caused by using a different field alias name in the project than in the geodatabase.  I think this is a bug. I think the REST API should be either using the geodatabase alias name or the project alias name.

Navigating to http:\\myserver\ArcGIS\rest\services\testservice\MapServer\5 returns a list of fields and the alias names as defined in the ArcSDE geodatabase.
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
L_NUMBER (Type: esriFieldTypeString, Alias: Number)
L_STYPE_CD (Type: esriFieldTypeInteger, Alias: GIS Subtype)
L_ID (Type: esriFieldTypeInteger, Alias: Auto ID)  //Auto ID is the alias applied to the geodatabase for this field


The identify operation on that layer returns a list of fields with alias names as defined from the project
"attributes" : {
"OBJECTID" : "540",
"Number" : "19348",
"GIS Subtype" : "Null",
"ID" : "8",   //ID is an alias i applied to the project, overriding the Auto ID alias from the geodatabase)

Can someone confirm this as a bug or let me know if this is as designed?
0 Kudos
RaviNarayanan
Esri Contributor
This is the expected behavior. By default the field alias shown in the map document will use the alias from the geodatabase. But if it is altered in the document, then the field alias that is set in the map document will override the alias set in the geodatabase.
>
"ID" : "8", //ID is an alias i applied to the project, overriding the Auto ID alias from the geodatabase)
>

The layer description should also list "ID" as the alias and not "Auto ID". Does that still show the alias as set in the geodatabase?

Thanks
Ravi
0 Kudos
NicoleSchmidt
New Contributor III
Ravi,

If that is the case, then why do the field names that are displayed when I go here:

http:\\myserver\ArcGIS\rest\services\testservice\MapServer\5

show the geodatabase alias names (not the aliases from the project)?

(this should probably be a separate topic, but the SOAP operation for LayerDescriptions also returns the alias defined in the geodatabase and not the one defined in the document).

So far the identify operation (and possibly Query I have not tested that) are the only ones that return the alias name from the Document.  Everything else seems to only return aliases as defined in the geodatabase.

Nicole
0 Kudos
NicoleSchmidt
New Contributor III
Sorry Ravi,

I missed your last question.  Just in case you cannot infer it from my response, here is the answer:

"The layer description should also list "ID" as the alias and not "Auto ID". Does that still show the alias as set in the geodatabase?"

The layer description shows "Auto ID"  (which is the alias as set in the geodatabase)
0 Kudos
RichardButgereit
Occasional Contributor
Worse than not returning the field names as specified, something I have noticed is that identify and query through the Flex viewers and REST services do not report any values described with domains from a geodatabase.

If you add a service in ArcMap and/or ArcGIS Explorer, and identify a feature, you will get the description and not the code. But if you use a Flex viewer and/or the REST Services Directory, the code will be reported, not the description from a domain in the geodatabase.

I really need some help figuring this out right now.
0 Kudos
NicoleSchmidt
New Contributor III
I believe this issue I found back in April is a bug.  How can I report this or get confirmation that it is a bug and is not as designed?

To replicate,

  1. Create a new feature class in an ArcSDE database.  Add at least one field to the feature class.  Give this field an alias of "alias1"

  2. Create a new project in ArcMap and add this layer.  Go to the field properties and set the alias for the one field you added to "alias2"

  3. Deploy the project as an MXD service to ArcServer 9.3.1

  4. Navigate to http:\\myserver\ArcGIS\rest\services\testservice\MapServer\1

  5. Notice that the field will display as "alias1"
  6. Now test the identify on that service.  The identify will return the field as "alias2".  I have not provided a specific URL to test the identify but I can if needed.


Do I need to call support to report this as a bug?


I figured it out.  It is caused by using a different field alias name in the project than in the geodatabase.  I think this is a bug. I think the REST API should be either using the geodatabase alias name or the project alias name.

Navigating to http:\\myserver\ArcGIS\rest\services\testservice\MapServer\5 returns a list of fields and the alias names as defined in the ArcSDE geodatabase.
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
L_NUMBER (Type: esriFieldTypeString, Alias: Number)
L_STYPE_CD (Type: esriFieldTypeInteger, Alias: GIS Subtype)
L_ID (Type: esriFieldTypeInteger, Alias: Auto ID)  //Auto ID is the alias applied to the geodatabase for this field


The identify operation on that layer returns a list of fields with alias names as defined from the project
"attributes" : {
"OBJECTID" : "540",
"Number" : "19348",
"GIS Subtype" : "Null",
"ID" : "8",   //ID is an alias i applied to the project, overriding the Auto ID alias from the geodatabase)

Can someone confirm this as a bug or let me know if this is as designed?
0 Kudos
RaviNarayanan
Esri Contributor
I believe this issue I found back in April is a bug.  How can I report this or get confirmation that it is a bug and is not as designed?


Thank you for the detailed explanation. I can reproduce this behavior in 9.3.1 SP2 and it seems related to NIM055784.. The bug is layer description does not report the field alias correctly for this case. The field alias as set in the Map Document should be returned in the layer description.

This is non-reproducible in 10.0 Final, where both layer description and the results of identify operation return the same field alias name as set in the Map Document

9.3.1 SP2
Layer description:
{"name" : "STATE_NAME", "type" : "esriFieldTypeString", "alias" : "State Name"},

Identify:
   "attributes" : {
        "OBJECTID" : "1",
        "State Name Alias 2" : "Washington",


10.0 Final
Layer description:
    {
      "name" : "STATE_NAME",
      "type" : "esriFieldTypeString",
      "alias" : "State Name Alias 2",
      "length" : 25},

Identify:
    "attributes" : {
        "OBJECTID" : "1",
        "AREA" : "Null",
        "State Name Alias 2" : "Washington",
0 Kudos