Select to view content in your preferred language

What is the reason behind the IdentifyResult obj returning alias names as attributes.

2230
5
10-29-2013 06:17 PM
Drew
by
Frequent Contributor
Hello,

I have a question for an ESRI developer or anyone who wants to chime in...

Why has it always been that the IdentifyResult object always returns a graphic with it's attributes as alias names?
This makes it very difficult to relate and join this object with other pieces of data through code.

Here is an example....

I want to  create a tool that uses the identify results and I want the "displayFieldName"  to be the label.
I originally thought i would get the label through code like..

graphic.attributes[displayFieldName].toString()


but because the IdentifyResult  object returns alias names this does not work because in this specific case the display field as been aliased..

I think the API is too mature to change things now, but what was the original thought or benefit for doing this?

Drew
Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   it is actually not an API thing it is how ArcGIS Server has alway handled the Identify operation. ArcGIS Server returns the alias for fields, so the API has to work with this.
0 Kudos
Drew
by
Frequent Contributor
Andrew,

   it is actually not an API thing it is how ArcGIS Server has alway handled the Identify operation. ArcGIS Server returns the alias for fields, so the API has to work with this.


Yes, that is correct Robert. It is a server operation that does return this type result. Sorry for the confusion.

Drew
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Drew,

   I handle this issue in my Identify widget by asking the map service for details of the layer and matching the alias to the actual field name (alot of work I know, but somethimes you just have to do what you have to do).
0 Kudos
Drew
by
Frequent Contributor
Drew,

   I handle this issue in my Identify widget by asking the map service for details of the layer and matching the alias to the actual field name (alot of work I know, but somethimes you just have to do what you have to do).


Thanks for the suggestion Robert. I have done similar workarounds.
I am primarily wondering why ESRI decided to do this. Is there an advantage that I am missing or was this an over site and should it be looked at or should there be an additional object that contains the fields we need in the IdentifyResult object.

It has just always been a frustrating part of the code to deal with. But ya, sometimes you got to do what you got to do..

Drew
0 Kudos
BjornSvensson
Esri Regular Contributor
I am primarily wondering why ESRI decided to do this. Is there an advantage that I am missing or was this an over site and should it be looked at or should there be an additional object that contains the fields we need in the IdentifyResult object.

It has just always been a frustrating part of the code to deal with.


Yes, that part can be frustrating. No, you're not missing anything (I think).  I'm not sure why it was decided that way 6+ years ago. I think that originally the "identify" was meant just as a way to quickly get some reasonably formatted information for a click-on-the-map.  But as you, and most other have found out, you rather have it return the real field names, so that you can do "more stuff".

This is why most people use the "Query" instead of "Identify" to do the identifying-on-map.  The "Query" does pretty much the same, plus more and better. So except for that it only works on one individual layer at a time, it is usually the better option.
0 Kudos