Display Field Expression

8663
9
11-16-2011 07:52 AM
SandeepKapadia
New Contributor
Hi

We have added a expression "Some String: " & [COUNTYNAME] to a layer in mxd. I have published this mxd as a service and when I see the REST end point for this service, the "Display Field" shows "COUNTYNAME" and not the expression.

How can make the REST to display the expression?

FYI: I have restarted the services and cleared the REST cache.

Sandeep
0 Kudos
9 Replies
TanuHoque
Esri Regular Contributor
REST API does not support Display Expression.
0 Kudos
SandeepKapadia
New Contributor
Then where does it get the field name "COUNTYNAME" from?
0 Kudos
RaviNarayanan
Esri Contributor
Sandeep,

Please see this help topic on how a display field name is chosen.

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Setting_field_properties,_aliases,_and...

The primary display field defaults to the first field of string type that contains the text "name" (case insensitive) in the field name. If no "name" field exists, the primary display field defaults to the first field of string type, then the first field of integer type, then the first field of any type. You can change the primary display field from the Fields tab of the Layer or Table Properties dialog box


Here is a similar help topic for a recent version:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s00000042000000.htm
0 Kudos
DavidWilton
Occasional Contributor
Even without an expression, just setting the field name in the 'display expression' isn't picked up either. I did find that the 'value' was based upon the selected field. Seems strange

Edit:

I hadn't cleared my REST cache

http://denverdemo.esri.com/ArcGIS/SDK/REST/admin.html
0 Kudos
RaviNarayanan
Esri Contributor
David,  Glad you were able to identify the cause. In the upcoming 10.1 version, the REST cache will be automatically managed each time a service is updated, so this will not be an issue.
0 Kudos
TanuHoque
Esri Regular Contributor
Just to clarify: when MapService sees a DisplayExpression, it uses the first field name used in that DisplayExpression. In your cases, your display expression ("Some String: " & [COUNTYNAME]) contains [COUNTYNAME] that's where [COUNTYNAME] is coming from...

Sorry about the late response.
0 Kudos
BillFox
MVP Frequent Contributor

As of v10.4 this issue is "In Product Plan" The Esri Development team has plans to address this issue or request in a future release of the software.

[NIM072888: Published map service does not respect the display expression applied to the layer]

0 Kudos
PascualBenito
New Contributor III

Thanks billfox‌. Do you know if this update made it into 10.5?

NicolasGIS
Occasional Contributor III

Hello Bill,

Do you have any link for this enhancement NIM072888 ?

I can't find it anywhere so I can't follow its status.

Is there any update (10.5, 10.6 ...) ? 

Thanks,