fieldAliases when using the identify task.

4087
12
11-11-2010 04:52 AM
TonyCollins
Occasional Contributor
Hi,

Can someone recommend the best way to do this? (Do I have to make multiple trips to the server?)
Tags (2)
0 Kudos
12 Replies
RobertScheitlin__GISP
MVP Emeritus
Tony,

   I am a little confused... The identify task only returns field aliases.
0 Kudos
TonyCollins
Occasional Contributor
Tony,

   I am a little confused... The identify task only returns field aliases.


Ah, hopefully I have something wrong then! This has been working fine for months but my users are asking for field Aliases to display rather than the Field Names (Which are unordered but no one seems to have that answer down).

When I inspect identifyResult.feature.attributes the object contains paired values [FIELDNAME, Value].

Does this make sense?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tony,

   I have to say a still don't understand, the fields that are returned are always aliases in my experience... Have you recently defined the fields alias and have yet to clear your rest cache and restart your map service? The field ordering issue has always been there, Abode does not guarantee the order of items in an array collection.
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos
TonyCollins
Occasional Contributor
Tony,

   I have to say a still don't understand, the fields that are returned are always aliases in my experience... Have you recently defined the fields alias and have yet to clear your rest cache and restart your map service? The field ordering issue has always been there, Abode does not guarantee the order of items in an array collection.


Thanks Robert,

What if you have no aliases defined? Does it resort to the field_name? I don't have any REST cache issue, but if that is the case then i will look there instead of my code!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tony,


   Yep that is exactly what happens. So all you have to do is define the fields aliases in ArcCatalog for the individual feature classes or in ArcMap if you only want those to be defined for that particular map service.
0 Kudos
AlaaBakry
New Contributor II

Robert is there any way to get field names instead of aliases in identify result?

I changed field aliases in the MXD, republished the map services, and cleared server cache, and still getting the aliases(maybe from datasource), any thoughts?

ArcGIS Server 10.3

JSAPI 3.14

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Alaa,

   Did you re-publish the map service? Have you checked to see if the map services rest endpoint has the updated alias values?

0 Kudos
AlaaBakry
New Contributor II

Hello Robert,
Yes the service rest has the latest aliases like this snapshot

and weirdly I get the identify results(check snapshot) with other names/aliases I don't know where they are coming from

I want to mention that i have only one layer that get the updated aliases in the identify task results, others are not!

Appreciate your support.

0 Kudos