<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: advanced label expression in Arcgis server doesn't label in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/1696841#M44089</link>
    <description>&lt;P&gt;It's been 13 years for this issue and the problem seems to be the same. I'm running into this issue too. Have there been any resolutions to this?&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2026 21:58:52 GMT</pubDate>
    <dc:creator>DanielWebb</dc:creator>
    <dc:date>2026-04-16T21:58:52Z</dc:date>
    <item>
      <title>advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232667#M8970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to use the following advanced label expression for a layer in a map service.&amp;nbsp; This javascript function works in arcmap, but does not label the features when its published as a map service.&amp;nbsp; In the publishing preview window the labels do appear, but not in the finished service.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function FindLabel ( [NPC_CATEGORY_ID] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;idArray=["231","371","372","375","376"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;codeArray=["WPn53","WMs83","WMs92","WPn53","WPn53"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var labelValue = [NPC_CATEGORY_ID];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var i=0,l=idArray.length; i&amp;lt;l; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if&amp;nbsp; (idArray&lt;I&gt; ==&amp;nbsp; [NPC_CATEGORY_ID] ){&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelValue = codeArray&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return labelValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although, it doesn't present a solution that I could use, the following thread is similar:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/70413-Handling-NULL-Dates-in-Labels?highlight=label"&gt;http://forums.arcgis.com/threads/70413-Handling-NULL-Dates-in-Labels?highlight=label&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have any thoughts on this one, please let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks greatly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sonia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 14:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232667#M8970</guid>
      <dc:creator>soniadickerson1</dc:creator>
      <dc:date>2013-02-11T14:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232668#M8971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's possible that JavaScript is not supported in ArcGIS Server (though I can't find any documentation to confirm that).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps try changing the parser to Python and rewrite it.&amp;nbsp; Here's what a more efficient version would look like in Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def FindLabel( [NPC_CATEGORY_ID] ):
&amp;nbsp;&amp;nbsp;&amp;nbsp; npcId = [NPC_CATEGORY_ID]
&amp;nbsp;&amp;nbsp;&amp;nbsp; idCodes = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "231": "WPn53",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "371": "WMs83",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "372": "WMs92",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "375": "WPn53",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "376": "WPn53"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if npcId in idCodes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return idCodes[npcId]
&amp;nbsp;&amp;nbsp;&amp;nbsp; return npcId
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or, here's what your original function looks like in Python without modification:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def FindLabel( [NPC_CATEGORY_ID] ):
&amp;nbsp;&amp;nbsp;&amp;nbsp; idArray = ["231","371","372","375","376"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; codeArray = ["WPn53","WMs83","WMs92","WPn53","WPn53"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; labelValue = [NPC_CATEGORY_ID]
&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(len(idArray)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if idArray&lt;I&gt; == [NPC_CATEGORY_ID]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelValue = codeArray&lt;I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return labelValue
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:45:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232668#M8971</guid>
      <dc:creator>JasonGreenlaw</dc:creator>
      <dc:date>2021-12-11T11:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232669#M8972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having a similar problem when using python to create an advanced label expression in my service.&amp;nbsp; My labels draw in my service, however, when looking at the properties in the rest endpoint, the "Labeling Info" comes up as null, even though the "Has Labels" property is true:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23776[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First I tried this with the advanced box checked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23777[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I tried writing it in one line without the advanced box checked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23778[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both work in the map, but the Labeling Info property is still null.&amp;nbsp; Is this a known issue? Should I try something different?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 23:08:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232669#M8972</guid>
      <dc:creator>JasonLevine</dc:creator>
      <dc:date>2013-04-25T23:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232670#M8973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I realized I could make this even simpler by removing the if statement (which I don't need):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23828[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm now using a very simple python string replace function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Replace([Name],"Chp","CHP")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still, nothing shows up for &lt;/SPAN&gt;&lt;STRONG&gt;Labeling Info&lt;/STRONG&gt;&lt;SPAN&gt; at the rest endpoint:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23829[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is something as simple as this causing an error in ArcGIS Server (10.1)?&amp;nbsp; I thought it was supposed to support python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 14:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232670#M8973</guid>
      <dc:creator>JasonLevine</dc:creator>
      <dc:date>2013-04-29T14:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232671#M8974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;LabelingInfo in a mapservice's layer's resources (on REST) always returns null when advanced-expression is used to define labels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dynamic map service's export call will draw them correctly though using the advanced labeling expression that you set in the source map, it is just that LabelingInfo will always be null (when advanced expression is used).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 16:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232671#M8974</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2013-05-28T16:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232672#M8975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;LabelingInfo in a mapservice's layer's resources (on REST) always returns null when advanced-expression is used to define labels.&lt;BR /&gt;&lt;BR /&gt;dynamic map service's export call will draw them correctly though using the advanced labeling expression that you set in the source map, it is just that LabelingInfo will always be null (when advanced expression is used).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for this information.&amp;nbsp; Why would the entire LabelingInfo object come up null just because an advanced expression is used? I'm trying to develop a label toggle feature into my table of contents panel and need to know the label min and max scales for each layer.&amp;nbsp; For me, the expression used is irrelevant.&amp;nbsp; Is there any other way to get at the information I need while still using an advanced label expression?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 18:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232672#M8975</guid>
      <dc:creator>JasonLevine</dc:creator>
      <dc:date>2013-06-02T18:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232673#M8976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also have a problem with labels not showing after publishing my service. All works fine and the labels shows up in the "Preview for Arc GIS Server" in the "Service Editor". Anyone found a solution to this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Anders&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 07:49:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/232673#M8976</guid>
      <dc:creator>AndersKarlgren</dc:creator>
      <dc:date>2013-08-30T07:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: advanced label expression in Arcgis server doesn't label</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/1696841#M44089</link>
      <description>&lt;P&gt;It's been 13 years for this issue and the problem seems to be the same. I'm running into this issue too. Have there been any resolutions to this?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 21:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/advanced-label-expression-in-arcgis-server-doesn-t/m-p/1696841#M44089</guid>
      <dc:creator>DanielWebb</dc:creator>
      <dc:date>2026-04-16T21:58:52Z</dc:date>
    </item>
  </channel>
</rss>

