How to filter fields and rename fields

641
1
10-31-2010 04:46 AM
ClintCabanero
Occasional Contributor
Hello,

Context:
I currently am working with the Identify task.  After calling identifyTask--> didExecuteWithIdentifyResults I get an array of identify results that currently has fields that I don't want (object_id, shape) and field names that I want to change (e.g. change 'shape_area' to read 'area').

Questions:
What is the best practice for filtering fields from the result of an identify task?  I want to remove fields from showing up in my results view controller.  I don't see that there is an 'out fields' concept where I can declare what fields I want returned back from the identify operation.  Is this available?

What is the best practice for renaming fields from the results of an identify task?  Is there some way I can tell the identify task to return fields using friendlier looking field aliases instead of the literal field name in the map service's underlying geodatabase?

Thanks!
0 Kudos
1 Reply
DiveshGoyal
Esri Regular Contributor
1) Filtering fields - You're right, there is no way currently to limit the fields being returned by the service on an operation by operation basis. You can, however, limit the fields by adjusting their visibility in the source map  document (.mxd or .msd). The service will honour your settings and will not return invisible fields. Keep in mind, this will affect other operations too, such as Query, Find, etc

Another option is for you to manually filter the fields in your application.

2) Renaming fields - You can specify user-friendly aliases for the fields in the source map document. The service will then return these aliases instead of the actual field names.

The other option is that you manually substitute field names with user-friendly names in your application.
0 Kudos