<?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: Label Expression Bug in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169279#M13066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;thanks for you help. I tried the ";" after the &amp;amp;amp and get a syntax error. If I put it after the ")" it labels but still the "&amp;amp;amp" in the name.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm an idiot! Finally put the ";" inside the quote and it worked! It's the little things that get you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Apr 2013 21:44:32 GMT</pubDate>
    <dc:creator>MarkPaulson</dc:creator>
    <dc:date>2013-04-19T21:44:32Z</dc:date>
    <item>
      <title>Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169274#M13061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have used the following example from the help file substitution my own fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [Parcel_No], [Owner_Name] ): &amp;nbsp; if&amp;nbsp; [Parcel_No]&amp;nbsp; &amp;gt;= 0: &amp;nbsp;&amp;nbsp;&amp;nbsp; return "&amp;lt;CLR red='255'&amp;gt;&amp;lt;FNT size = '14'&amp;gt;" + unicode( [Owner_Name]) + "&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;" &amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp; return [Owner_Name] &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The label shows in my feature class as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt; &amp;lt;CLR red='255'&amp;gt;&amp;lt;FNT size = '14'&amp;gt;Doe, John &amp;amp; Linda&amp;lt;/FNT&amp;gt;&amp;lt;/CLR&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not in the color red. It shows correctly in the verify box in the expression verification. Also, why do I have to use unicode([FIELD_NAME]) to avoid an error?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 11:16:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169274#M13061</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-04-19T11:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169275#M13062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ampersand (&amp;amp;) and angle bracket (&amp;lt;) are special characters&amp;nbsp; and will interfere with the formatting tags. You have to replace them with code similar to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Function FindLabel ([LABELFIELD])
&amp;nbsp; NewString = Replace([LABELFIELD],"&amp;amp;","&amp;amp;amp;")&amp;nbsp; 
&amp;nbsp; FindLabel = "&amp;lt;ITA&amp;gt;" &amp;amp; NewString &amp;amp; "&amp;lt;/ITA&amp;gt;"
End Function
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s80000000p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;help page&lt;/A&gt;&lt;SPAN&gt; on formatting tags&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:47:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169275#M13062</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T08:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169276#M13063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The ampersand (&amp;amp;) and angle bracket (&amp;lt;) are special characters&amp;nbsp; and will interfere with the formatting tags. You have to replace them with code similar to this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Function FindLabel ([LABELFIELD])
&amp;nbsp; NewString = Replace([LABELFIELD],"&amp;amp;","&amp;amp;amp;")&amp;nbsp; 
&amp;nbsp; FindLabel = "&amp;lt;ITA&amp;gt;" &amp;amp; NewString &amp;amp; "&amp;lt;/ITA&amp;gt;"
End Function
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;See the &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s80000000p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;help page&lt;/A&gt; on formatting tags&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Read that many times, but that is VBA which I know even less about than Python &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tried the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel ( [Owner_Name] ):
&amp;nbsp; test =&amp;nbsp; [Owner_Name].replace( '&amp;amp;', '&amp;amp;amp')
&amp;nbsp; return "&amp;lt;CLR red='255'&amp;gt;" + test + "&amp;lt;/CLR&amp;gt;"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But now get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;lt;CLR red='255'&amp;gt;Mr &amp;amp;amp Mrs John Doe&amp;lt;/CLR&amp;gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169276#M13063</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2021-12-11T08:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169277#M13064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need the ";" after the &amp;amp;amp&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 18:20:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169277#M13064</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-04-19T18:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169278#M13065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You need the ";" after the &amp;amp;amp&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for you help. I tried the ";" after the &amp;amp;amp and get a syntax error. If I put it after the ")" it labels but still the "&amp;amp;amp" in the name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 19:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169278#M13065</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-04-19T19:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169279#M13066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;thanks for you help. I tried the ";" after the &amp;amp;amp and get a syntax error. If I put it after the ")" it labels but still the "&amp;amp;amp" in the name.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm an idiot! Finally put the ";" inside the quote and it worked! It's the little things that get you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 21:44:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169279#M13066</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-04-19T21:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169280#M13067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I finally got my labeling to work as I wanted: screen shot attached. Below is the code that made it work. I discovered that that having nulls in a field caused lots of problem so I just filled with dummy text. Anyway, if some one could look at the code and maybe suggest a more elegant approach I would appreciate the effort. Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel ( [Owner_Name], [Owner_St], [Parcel_No], [Owner_City], [Owner_State], [Property_ID] ):
&amp;nbsp; parcelNo = "&amp;lt;BOL&amp;gt;" + "Parcel No.: " + "&amp;lt;/BOL&amp;gt;" + [Parcel_No] 
&amp;nbsp; propertyID =&amp;nbsp; propertyID = "&amp;lt;BOL&amp;gt;" + "Property ID: " + "&amp;lt;/BOL&amp;gt;" + [Property_ID] 
&amp;nbsp; ownerTemp = [Owner_Name].title()
&amp;nbsp; ownerName =&amp;nbsp; "&amp;lt;BOL&amp;gt;" + "Owner: " + "&amp;lt;/BOL&amp;gt;" + ownerTemp.replace( '&amp;amp;', '&amp;amp;amp;')
&amp;nbsp; streetAdd = "&amp;lt;BOL&amp;gt;" + "Address: " + "&amp;lt;/BOL&amp;gt;" +&amp;nbsp; [Owner_St].title()
&amp;nbsp; ownerCity = "&amp;lt;BOL&amp;gt;&amp;lt;CLR black = '0'&amp;gt;" +"Address: "+ "&amp;lt;/CLR&amp;gt;&amp;lt;/BOL&amp;gt;" +&amp;nbsp; [Owner_City].title() 
&amp;nbsp; LF= '\n'
&amp;nbsp; strResult = parcelNo+&amp;nbsp; LF+ propertyID + LF +&amp;nbsp; ownerName +&amp;nbsp; LF +&amp;nbsp; streetAdd + LF + ownerCity + ", "+ [Owner_State] 
&amp;nbsp; return strResult&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169280#M13067</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2021-12-11T08:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Bug</title>
      <link>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169281#M13068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;it worked! It's the little things that get you.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's good to hear. Don't forget to click the check mark to signify your original question was answered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the issue you're running into with the null fields? You can check for nulls and skip them if necessary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 14:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression-bug/m-p/169281#M13068</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-04-22T14:52:11Z</dc:date>
    </item>
  </channel>
</rss>

