<?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 Label script help- excluding one record from labeling in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721975#M9714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly new to mainpulating the label expressions in ArcMap. I am not sure how to exclude some records from displaying. For example there are 20 cities on my map, but I'd like to exclude 2 from labeling on my map. I want to be able to still see the point where they are...but not the text. I also would prefer not to make a new shapefile, column, or create a layer based on selection. Any ideas on the expression that could be written? I'd prefer VB, but open to jscript too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ArcMap 10 and Maplex. The field I'm using is called "POI_NAME"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2012 19:45:27 GMT</pubDate>
    <dc:creator>KelleeRoberts</dc:creator>
    <dc:date>2012-12-18T19:45:27Z</dc:date>
    <item>
      <title>Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721975#M9714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly new to mainpulating the label expressions in ArcMap. I am not sure how to exclude some records from displaying. For example there are 20 cities on my map, but I'd like to exclude 2 from labeling on my map. I want to be able to still see the point where they are...but not the text. I also would prefer not to make a new shapefile, column, or create a layer based on selection. Any ideas on the expression that could be written? I'd prefer VB, but open to jscript too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ArcMap 10 and Maplex. The field I'm using is called "POI_NAME"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 19:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721975#M9714</guid>
      <dc:creator>KelleeRoberts</dc:creator>
      <dc:date>2012-12-18T19:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721976#M9715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could modify this sample expression, make sure to hit the advanced box and paste this in.&amp;nbsp; You will need to change City1 and City2 to the values of the cities you want to exude.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function FindLabel ([POI_NAME])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If [POI_NAME] = "City1" or [POI_NAME] = "City2" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = [POI_NAME]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code isn't pasting properly, but make sure that you tab in right before each instance of FindLabel.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 21:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721976#M9715</guid>
      <dc:creator>MatthewPatterson</dc:creator>
      <dc:date>2012-12-18T21:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721977#M9716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Matt! Worked like a charm. Also, the formatting was just fine. I tried adding a tab before each "FindLable" but wasn't able to. Decided to give it a shot anyway, and it worked. I'll be saving this code for future use! Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 15:25:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721977#M9716</guid>
      <dc:creator>KelleeRoberts</dc:creator>
      <dc:date>2012-12-19T15:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721978#M9717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked perfect, Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 18:00:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721978#M9717</guid>
      <dc:creator>FredaKuhl</dc:creator>
      <dc:date>2017-09-22T18:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721979#M9718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get this to work for a numeric wildcard?&amp;nbsp; I want to exclude from labeling all values of SITE that start with 18 so I put this together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [SITE] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp;if int([SITE]) == '18%':&lt;BR /&gt;&amp;nbsp; return " "&lt;BR /&gt;&amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; return [SITE]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax checks out, but all the values that start with 18 are still labeled.&amp;nbsp; If I take away the quotes around the 18 I get a syntax error.&amp;nbsp; What gives?&amp;nbsp; Is there no wildcard term for numbers in Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 18:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721979#M9718</guid>
      <dc:creator>KeithAddison1</dc:creator>
      <dc:date>2018-07-20T18:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721980#M9719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are mixing two formats&amp;nbsp;(VBscript and Python).&amp;nbsp;The field SITE using the Python parser&amp;nbsp;should be expressed as !&lt;SPAN style="background-color: #ffffff;"&gt;SITE!.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You could use something like this with the Python parser:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FindLabel&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;site&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;site&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'18'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; site&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression should be:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Findlabel(!SITE!)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it with this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tests &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;18&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;182&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1807&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;18874&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1901&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;17&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1981&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; test &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; tests&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"in: {}, label:{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;test&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FindLabel&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;test&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FindLabel&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;site&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;site&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'18'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; site

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__main__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; main&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which resulted in:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;in: 18, label:
in: 182, label:
in: 1807, label:
in: 18874, label:
in: 1901, label:1901
in: 17, label:17
in: 1981, label:1981&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All values that start with 18 result in an empty string&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721980#M9719</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T06:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Label script help- excluding one record from labeling</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721981#M9720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its weird how the in program label expression builder when set to Python still uses [XYZ] for the fields. (in ArcMap 10.3)&amp;nbsp; Thanks, I wasn't aware of the startswith method, the code works now as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [SITE] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp;if str([SITE]).startswith('18') == True:&lt;BR /&gt;&amp;nbsp; return " "&lt;BR /&gt;&amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; return [SITE]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/label-script-help-excluding-one-record-from/m-p/721981#M9720</guid>
      <dc:creator>KeithAddison1</dc:creator>
      <dc:date>2018-07-23T13:37:30Z</dc:date>
    </item>
  </channel>
</rss>

