<?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: Adding onto an Elseif statement in label expression for ArcMap 10.5 in Map Advice Community Questions</title>
    <link>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773666#M26</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the Help under Layer&amp;gt;&amp;gt;Labels&amp;gt;&amp;gt;Expression:&lt;/P&gt;&lt;P&gt;Building label expressions&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Function FindLabel ([NAME], [POPULATION])   if (cLng([POPULATION]) &amp;gt;= 250000) then    FindLabel = "&amp;lt;CLR red='255'&amp;gt;&amp;lt;FNT size = '14'&amp;gt;" + [NAME] + "&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;"   else 	 FindLabel = [NAME]   end if End Function
&lt;/CODE&gt;You will need to modify the fields/variables to match your needs.
The formatting tag for bold is &amp;lt;BOL&amp;gt; followed by &amp;lt;/BOL&amp;gt;
This information is available under "Using Formatting Tags" in the help.

Best Regards,
Jim&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:54:07 GMT</pubDate>
    <dc:creator>JimCousins</dc:creator>
    <dc:date>2021-12-12T16:54:07Z</dc:date>
    <item>
      <title>Adding onto an Elseif statement in label expression for ArcMap 10.5</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773665#M25</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am admittedly a novice when it comes to coding but I have written a fairly simple Elseif VBscript in the the Label Expression in ArcMap 10.5. The expression shown below is for Overhead Conductors and currently will display a label based on what phase&amp;nbsp;is input into the&amp;nbsp;&lt;EM&gt;Conductor&amp;nbsp;&lt;/EM&gt;fields&amp;nbsp;(ConductorA, ConductorB, ConductorC, ConductorN ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to add onto this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field called&amp;nbsp;&lt;EM&gt;Construction Status&amp;nbsp;&lt;/EM&gt;which contains coded values (Installed, Proposed, Other). I would like the labels for my Overhead Conductors to become bold and a larger font when the&amp;nbsp;&lt;EM&gt;Construction Status&amp;nbsp;&lt;/EM&gt;field says Proposed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried some basic HTML coding but I keep receiving error messages when trying to verify and am currently at a lose with the little coding experience I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ( [conductora], [conductorb], [conductorc], [conductorn] )&lt;BR /&gt;dim a&lt;BR /&gt;if [conductora] &amp;lt;&amp;gt; "" and [conductora] &amp;lt;&amp;gt; "NA" then&lt;BR /&gt;a = a &amp;amp; [conductora] &lt;BR /&gt;elseif [conductorb] &amp;lt;&amp;gt; "" and [conductorb] &amp;lt;&amp;gt; "NA" then&lt;BR /&gt;a = a &amp;amp; [conductorb] &lt;BR /&gt;elseif [conductorc] &amp;lt;&amp;gt; "" and [conductorc] &amp;lt;&amp;gt; "NA"then&lt;BR /&gt;a = a &amp;amp; [conductorc] &lt;BR /&gt;elseif [conductorn] &amp;lt;&amp;gt; ""and [conductorn] &amp;lt;&amp;gt; "NA" then&lt;BR /&gt;a = a &amp;amp; [conductorn] &lt;BR /&gt;end if&lt;BR /&gt;FindLabel = a&lt;BR /&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 15:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773665#M25</guid>
      <dc:creator>AriLukas</dc:creator>
      <dc:date>2019-03-08T15:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding onto an Elseif statement in label expression for ArcMap 10.5</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773666#M26</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the Help under Layer&amp;gt;&amp;gt;Labels&amp;gt;&amp;gt;Expression:&lt;/P&gt;&lt;P&gt;Building label expressions&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Function FindLabel ([NAME], [POPULATION])   if (cLng([POPULATION]) &amp;gt;= 250000) then    FindLabel = "&amp;lt;CLR red='255'&amp;gt;&amp;lt;FNT size = '14'&amp;gt;" + [NAME] + "&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;"   else 	 FindLabel = [NAME]   end if End Function
&lt;/CODE&gt;You will need to modify the fields/variables to match your needs.
The formatting tag for bold is &amp;lt;BOL&amp;gt; followed by &amp;lt;/BOL&amp;gt;
This information is available under "Using Formatting Tags" in the help.

Best Regards,
Jim&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773666#M26</guid>
      <dc:creator>JimCousins</dc:creator>
      <dc:date>2021-12-12T16:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding onto an Elseif statement in label expression for ArcMap 10.5</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773667#M27</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I'm a bit rusty with VBScript, I'm familiar with Python enough to be able to fiddle around with if statements. I'm not sure if this is exactly what you were aiming for, but you may be able to modify this a bit to suit your needs. You'd have to choose the Python parser and check Advanced for it to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;def FindLabel ( [conductora], [conductorb], [conductorc], [conductorn]):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; a=""&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;if str([conductora]) not in ["None","NA"]:&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;a=a+"A"+str([conductora])&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;if str([conductorb]) not in ["None","NA"]:&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;a=a+"B"+str([conductorb])&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;if str([conductorc]) not in ["None","NA"]:&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;a=a+"C"+str([conductorc])&lt;BR /&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;if str([conductorn]) not in ["None","NA"]:&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;a=a+"N"+str([conductorn])&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;return a&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an image of the final results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/439051_TestExpression.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully that, plus some formatting, gets you what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thought is to use Label Classes to modify expressions based on subsets of your data. Then you won't have to deal with the if/else logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/displaying-labels-using-label-classes-to-label-fea.htm" title="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-text/displaying-labels-using-label-classes-to-label-fea.htm"&gt;Using label classes to label features from the same layer differently—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need clarification, let us know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;&lt;P&gt;Esri Support Services&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 17:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/adding-onto-an-elseif-statement-in-label/m-p/773667#M27</guid>
      <dc:creator>rachelg_esri</dc:creator>
      <dc:date>2019-03-08T17:42:36Z</dc:date>
    </item>
  </channel>
</rss>

