Select to view content in your preferred language

Results from IdentifyTask are not correct (indexed by Field Alias)

876
4
11-01-2010 01:57 PM
JacekSobolewski
Deactivated User
Hi,
Here is my question:
When I execute the following piece of code:
            var task = new IdentifyTask(url);
            task.ExecuteCompleted += Task_ExecuteCompleted;
            task.ExecuteAsync(idParams);

        private void Task_ExecuteCompleted(object sender, IdentifyEventArgs e)
        {
            if (e == null) return;
            if (e.IdentifyResults == null) return;
        }
the returned results are indexed by the field alias name. I would expect the attributes of the graphic results to be indexed by the field name. This is a problem because field aliases are not unique and therefore the results will be erroneous. What is the logic of returning the results indexed by the field alias name?
Regards,
Jacek Sobolewski
jacek.sobolewski@telvent.com
0 Kudos
4 Replies
AliMirzabeigi
Emerging Contributor
Thank you for your report. This issue is not related to any of the ESRI Web APIs (JavaScript, Silverlight, and FLEX) and we have forwarded this issue to the ArcGIS Server team and they are currently looking into this.

At the moment you can perform a spatial query on your layer and retrieve the attributes from the results sent back from the server, then look for the attribute keys of each Graphic object.

Another alternative solution would be not having the alias names defined for the fields in your service, but this might affect some use cases of your application; e.g. FeatureDataForm automatically shows alias names associated with each attribute of your layer, etc...

Hope this helps.
0 Kudos
JacekSobolewski
Deactivated User
Thank you for your answer.
Do you know whether there are any plans to correct this issue in the near future?
This is a big deal for us. I hope that the Identify functionality can be similar to the Query one. That is it returns both field names and field aliases.

Regards,
Jacek Sobolewski
jacek.sobolewski@telvent.com
0 Kudos
AliMirzabeigi
Emerging Contributor
Please take a look at the SDK sample here http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery to get the whole idea of the spatial queries. You would need to relpace the QueryTask Url (in its .ctor inside the "MyDrawSurface_DrawComplete" event handler) with Url of layers (or visible layers depending your application logic) in your server.

Regarding your first question unfortunately I don't know about the fix plan and its ETA, sorry!
0 Kudos
JacekSobolewski
Deactivated User
Thank you for the quick reply.
Regards,
Jacek Sobolewski
0 Kudos