stevel

Query.Outfields - reading aliases from the Map document

Discussion created by stevel on Sep 6, 2010
Latest reply on Sep 9, 2010 by DSwingley-esristaff
The Query help page at http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/query.htm says:

"Outfields - You must list the actual field names rather than the alias names... However, you are able  to use the alias names when you display the results. You can set field  alias names in the map document"

All of the samples use hard-coded alias names, eg:

infoTemplate.setContent("<b>2000 Population: </b>${POP2000}<br/>"

Does anyone know the syntax to retrieve the field alias programatically from the ArcGIS Server services endpoint?

ie, rather than hard-coding 2000 Population, how could you retrieve it from the ${POP2000} parameter? I'm trying to write a generic query function which can be used by multiple layers, with different schemas.

Thanks,
Steve

Outcomes