<?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: Labeling using ampersand (&amp;amp;) symbol in text via Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255752#M65199</link>
    <description>&lt;P&gt;Well that seemed to solve that issue, but creates a new one now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can often have just the WIDTH supplied without a NAME.&amp;nbsp; This code won't display it if there is no NAME given.&lt;/P&gt;&lt;P&gt;Also, if I add in a Route and not ALT_NAME, it duplicates the NAME field.&lt;BR /&gt;&lt;BR /&gt;This is one interesting things you're trying to solve here ha...&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 15:59:35 GMT</pubDate>
    <dc:creator>PeteJordan</dc:creator>
    <dc:date>2023-02-07T15:59:35Z</dc:date>
    <item>
      <title>Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254313#M65001</link>
      <description>&lt;P&gt;&amp;nbsp; I've got a number of different labeling scripts I use and they all at least contain one NAME type field I display.&amp;nbsp; On the rare occasion, I have names that contain the "&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;"&amp;nbsp;&lt;EM&gt;(such as "Rough &amp;amp; Ready")&lt;/EM&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I know the ampersand is a special character and when I use it in my script it starts displaying the other fileds parameters in the output text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of one of my simple labeling codes in Python:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;def FindLabel([Name_1],[Width_1]):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;str_list = []&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;if [Name_1] not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", "0"):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append([Name_1])&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;if [Width_1] not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", "0", " ","Varies"):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;Width_1_str = '&amp;lt;ITA&amp;gt;Width = {}\'&amp;lt;/ITA&amp;gt;'.format("&amp;lt;ITA&amp;gt;" + [Width_1] + "&amp;lt;/ITA&amp;gt;")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append(Width_1_str)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;label_str = '\n'.join(str_list)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#800080"&gt;return(label_str)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have found an example using VB and somehow incorporating&amp;nbsp;&lt;STRONG&gt;"&amp;amp;","&amp;amp;amp;"&lt;/STRONG&gt; into the script, but I have played around with adding variations of that in my code, but I can't seem to get it to work without errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Any ideas how to simply allow&amp;nbsp;&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt; into my&amp;nbsp;&lt;STRONG&gt;Name_1&lt;/STRONG&gt; field in this example?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 14:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254313#M65001</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-02T14:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254357#M65008</link>
      <description>&lt;P&gt;Are you passing&amp;nbsp; [Name_1] as a string?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 15:57:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254357#M65008</guid>
      <dc:creator>AngelaSchirck</dc:creator>
      <dc:date>2023-02-02T15:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254358#M65009</link>
      <description>&lt;P&gt;Just what's shown in the code above.&amp;nbsp; The actual fied is a text field though in the dataset...&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Feb 2023 16:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254358#M65009</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-02T16:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254477#M65019</link>
      <description>&lt;P&gt;Not sure your desired output, or input for that matter, but I don't seem to have an issue with the ambersand in a string variable.&amp;nbsp; You are, however, calling a lot of your "variables" lists.&amp;nbsp; Python uses the !variable! to define the input variables, not [variable].&amp;nbsp; Is Width_1 a numeric or text field.&amp;nbsp; If numeric, putting quotes around the zero's signify that they are text, and if width is number, will still append it if 0.&amp;nbsp; Also, the .format() was duplicating the &amp;lt;ITA&amp;gt; tags as well.&amp;nbsp; If that is what you were after, you will have to add that back in.&lt;/P&gt;&lt;P&gt;Try this code, see if it gets you closer to what you are after:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel([Name_1],[Width_1]):

str_list = []
if [Name_1] not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", 0):
   str_list.append([Name_1])

if [Width_1] not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", 0, " ","Varies"):
   Width_1_str = '&amp;lt;ITA&amp;gt;Width = {}\'&amp;lt;/ITA&amp;gt;'.format(str([Width_1]))
   str_list.append(Width_1_str)

label_str = '\n'.join(str_list)
return(label_str)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1675362140553.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61978i973A0DBDA35AC163/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1675362140553.png" alt="RhettZufelt_0-1675362140553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 19:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254477#M65019</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-02T19:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254486#M65022</link>
      <description>&lt;P&gt;&amp;nbsp; Well first off, the WIDTH is not always a numeric field, it can sometimes be a text field depending on who gives us the data.&amp;nbsp; This is also one of the simple labeling functions I do, there could be a number of other fields that also get displayed.&amp;nbsp; I just used these two NAME and WIDTH as an easy example.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The code you suggested returned an error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amp_Error1.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61980i86AE64C815E4D010/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amp_Error1.jpg" alt="Amp_Error1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of what I am experiencing&lt;/P&gt;&lt;P&gt;This is how my names should look and in this case I substituted the &lt;STRONG&gt;'&amp;amp;&lt;/STRONG&gt;' with'&lt;STRONG&gt;and&lt;/STRONG&gt;'.&amp;nbsp; It also has the &lt;STRONG&gt;width&lt;/STRONG&gt; field shown as well in itallics.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amp_ex1.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61981iD0ED56BB6E2BC76E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amp_ex1.jpg" alt="Amp_ex1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example 2 &lt;STRONG&gt;(amp_ex2.jpg)&lt;/STRONG&gt; shows what I am getting if I use the &lt;STRONG&gt;'&amp;amp;&lt;/STRONG&gt;' instead... &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amp_ex2.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61982iEB8D928C182F8E17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amp_ex2.jpg" alt="Amp_ex2.jpg" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 18:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254486#M65022</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-02T18:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254506#M65025</link>
      <description>&lt;P&gt;Sorry, my mistake on that error.&amp;nbsp; I have edited that post, guess still stuck on the ArcMap way of having to actually call that function in the label editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 18:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254506#M65025</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-02T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254564#M65035</link>
      <description>&lt;P&gt;So that at least shortened the script a bit by removing like you said the extra itallics from the &lt;STRONG&gt;WIDTH&lt;/STRONG&gt; part, but I still have the same issue with the &lt;STRONG&gt;NAME&amp;nbsp;&lt;/STRONG&gt;and using&amp;nbsp;&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;&amp;nbsp;in the name as in my last screen shot...&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 20:25:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254564#M65035</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-02T20:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254583#M65038</link>
      <description>&lt;P&gt;It appears as if 2.9.3 won't honor the &amp;lt;ITA&amp;gt; tags, so was getting nowhere.&amp;nbsp; However, I decided to replace the italics tag with &amp;lt;BOL&amp;gt; tags for testing.&lt;/P&gt;&lt;P&gt;However, according to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/text-formatting-tags.htm" target="_self"&gt;this page&lt;/A&gt;,&amp;nbsp; &amp;nbsp;&lt;EM&gt;"The ampersand (&amp;amp;) and angle bracket (&amp;lt;) are special characters and are not valid in your text if formatting tags are used. Use the equivalent character codes&amp;nbsp;&lt;SPAN class=""&gt;&amp;amp;amp;&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class=""&gt;&amp;amp;lt;&lt;/SPAN&gt;&amp;nbsp;instead.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Annotation&lt;/EM&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;EM&gt;Instead of &amp;lt;ITA&amp;gt;John &amp;amp; Paul&amp;lt;/ITA&amp;gt;, use:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;ITA&amp;gt;John &amp;amp;amp; Paul&amp;lt;/ITA&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;So, will have to look for the special character, and if there, replace with &amp;amp;amp;.&lt;/P&gt;&lt;P&gt;With lines 5 and 6 commented out:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1675370632990.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62003iB087CFE9E3B5562B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1675370632990.png" alt="RhettZufelt_0-1675370632990.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, uncommented:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_1-1675370651861.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62004i0E4BF8F978972158/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_1-1675370651861.png" alt="RhettZufelt_1-1675370651861.png" /&gt;&lt;/span&gt;&lt;P&gt;Hope this helps figure out what is going on.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Feb 2023 20:46:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254583#M65038</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-02T20:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254637#M65049</link>
      <description>&lt;P&gt;Ok I got the Name part working with the&amp;nbsp;&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt; which is great and thank you for that.&lt;/P&gt;&lt;P&gt;In the larger code&amp;nbsp;&lt;EM&gt;(which is different than the example I showed you),&amp;nbsp;&lt;BR /&gt;&lt;/EM&gt;I am trying to apply that to 2 fields out of 4.&amp;nbsp; In this example&amp;nbsp;&lt;STRONG&gt;NAME&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;ALT_NAME&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I run into issues when trying to do it for a 2nd field.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's the code that I can't seem to get working.&amp;nbsp; One issue is that you stated the &amp;lt;ITA&amp;gt; and such may not be supported in this fashion, 2nd I can't get this code to work at all regardless of where I place the ALT_NAME1&amp;nbsp; if statements for the &lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#800080"&gt;def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;str_list = []&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;NAME1=[NAME]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;ALT_NAME1=[ALT_NAME]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;ROUTE1=[ROUTE]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;WIDTH1=[WIDTH]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;if '&amp;amp;' in NAME1:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;NAME1=NAME1.replace("&amp;amp;","&amp;amp;amp;")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;if NAME1 not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", "0"):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append(NAME1)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#800080"&gt;if '&amp;amp;' in ALT_NAME1:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;ALT_NAME1=ALT_NAME1.replace("&amp;amp;","&amp;amp;amp;") &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;if ALT_NAME1 not in (None,"&amp;lt;NULL&amp;gt;", "", "0"):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;altname_str = "&amp;lt;ITA&amp;gt;&amp;lt;FNT size = '6'&amp;gt;({})&amp;lt;/FNT&amp;gt;&amp;lt;/ITA&amp;gt;".format(str([ALT_NAME]))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append(altname_str)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#800080"&gt;if ROUTE1 not in (None,"&amp;lt;NULL&amp;gt;", "", "0"):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;route_str = "RT#: {}".format([ROUTE])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append(route_str)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#800080"&gt;if WIDTH1 not in (None, "&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;", "", "0", " "):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;width_str = "&amp;lt;ITA&amp;gt;Width = {}'&amp;lt;/ITA&amp;gt;".format(str([WIDTH]))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;str_list.append(width_str)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#800080"&gt;label_str = '\n'.join(str_list)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#800080"&gt;return(label_str)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 21:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254637#M65049</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-02T21:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254666#M65056</link>
      <description>&lt;P&gt;For future pasting of code, look at this &lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;post&lt;/A&gt;, makes it a lot easier to visualize as well as copy/paste.&lt;/P&gt;&lt;P&gt;As far as it not working for ALT_NAME, you are substituting [ALT_NAME] in with the .format, but it is ALT_NAME1&amp;nbsp; that you did the replace on.&amp;nbsp; Simple fix.&lt;/P&gt;&lt;P&gt;Also, you said could be text, could be numeric.&amp;nbsp; Comparing strings with in/not in and None doesn't neccesarily produce consistent results.&amp;nbsp; I modified this a little to first, see if there is a value in the variable (not Null), then, compare the str(variable) with the not in staments.&amp;nbsp; Seems to produce the results we're after.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):
    str_list = []

    NAME1=[NAME]
    ALT_NAME1=[ALT_NAME]
    ROUTE1=[ROUTE]
    WIDTH1=[WIDTH]
    if NAME1:                                        # checks to see if value or Null
        if '&amp;amp;' in NAME1:                             # as string value can print as None, but doesn't work with "not in"
            NAME1=NAME1.replace("&amp;amp;","&amp;amp;amp;")

        if str(NAME1).strip not in ("&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","0"):   
            str_list.append(NAME1)
    if ALT_NAME1:
        if '&amp;amp;' in ALT_NAME1:
            ALT_NAME1=ALT_NAME1.replace("&amp;amp;","&amp;amp;amp;")
        if str(ALT_NAME1).strip() not in ("&amp;lt;NULL&amp;gt;","0"):
            altname_str = "&amp;lt;BOL&amp;gt;&amp;lt;FNT size = '6'&amp;gt;({})&amp;lt;/FNT&amp;gt;&amp;lt;/BOL&amp;gt;".format(str(ALT_NAME1))
            str_list.append(altname_str)
    if ROUTE1:
        if str(ROUTE1).strip not in ("&amp;lt;NULL&amp;gt;", "0"):
            route_str = "RT#: {}".format(ROUTE1)
            str_list.append(route_str)
    if WIDTH1:
        if str(WIDTH1).strip() not in ("&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","0"):
            width_str = "&amp;lt;BOL&amp;gt;Width = {}'&amp;lt;/BOL&amp;gt;".format(str(WIDTH1))
            str_list.append(width_str)

    label_str = '\n'.join(str_list)
    return(label_str)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1675377692234.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62017i407C6DBDBAA35ADB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1675377692234.png" alt="RhettZufelt_0-1675377692234.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Of course, since my version of Pro doesn't honor the ITA tags, I used BOL to see that it is working.&lt;/P&gt;&lt;P&gt;You will need to replace them if you want italics instead (if it works in your version).&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 22:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254666#M65056</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-02T22:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254815#M65085</link>
      <description>&lt;P&gt;&amp;nbsp; Thanks so much, and I actually used the code block in the past and just forgot how to use it, so thanks for that refresher for my future questions on the forum.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; I liked how you explained everything and that made it much easier to understand why you changed what you did.&amp;nbsp; Now I can update my document with this and make it a lot more inclusive to the types of naming conventions we get.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; With the Width, yes we can get just numeric values or such things like "8FT" or "Varies", so I always have to treat that as a text field&amp;nbsp;&lt;EM&gt;(I forgot to include the "varies" back into the code, but that's an easy fix)&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Thanks so much for this help...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:56:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254815#M65085</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-03T13:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254843#M65088</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;@&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530" target="_self"&gt;&lt;SPAN class=""&gt;RhettZufelt&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; I did run into an issue though.&amp;nbsp; As I mentioned before, the WIDTH can actually be a string in some cases or numeric in other cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp; So right now this code works if the WIDTH is a String, but it fails if it's numeric and WIDTH=0.&amp;nbsp; So I've tried to add in just a 0 into the code, but it doesn't seem to ignore that.&amp;nbsp; I've also tried to use the None as well without success.&lt;/P&gt;&lt;P&gt;(Note I had to change the name of the Width_1 to WDTH_TMP to make it easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I'm trying without success if the value is 0 and WIDTH is actually a numeric field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;  if str(WDTH_TMP).strip() not in (None,"&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","0",0):&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 14:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1254843#M65088</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-03T14:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255413#M65161</link>
      <description>&lt;P&gt;Apperantly, python evaluates a zero as emtpy, but not None/Null.&lt;/P&gt;&lt;P&gt;the If WDTH_TMP:&amp;nbsp; comparison will evaluate to false if NAME1 is numeric and = 0 so is bailing out before the next comparison.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1675703313444.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62181i6ECFBAE87A7FBBC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1675703313444.png" alt="RhettZufelt_0-1675703313444.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you change it to 'is not None', it shouldn't have this issue:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    if NAME1 is not None::                                        # checks to see if value or Null
        if '&amp;amp;' in NAME1:                             # as string value can print as None, but doesn't work with "not in"
            NAME1=NAME1.replace("&amp;amp;","&amp;amp;amp;")

        if str(NAME1).strip not in ("&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","0"):   
            str_list.append(NAME1)&lt;/LI-CODE&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 17:10:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255413#M65161</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-06T17:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255427#M65162</link>
      <description>&lt;P&gt;&amp;nbsp; Though the problem now is I can't exclude some of the text variables that might show up if that field is a Text rather than Numeric.&amp;nbsp; I have gotten this version of the code to work without any issues.&amp;nbsp; The only problem of course is the labeling features such as font size and Itallics aren't included, but I can deal with that as the "&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;' in the NAME or ALT_NAME is more important.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Thanks for your help though on this again...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):

  str_list = []
  if [NAME] not in (None, "&amp;lt;NULL&amp;gt;", "", "0"):
    str_list.append([NAME])

  if [ALT_NAME] not in (None,"&amp;lt;NULL&amp;gt;", "", "0"):
    altname_str = '({})'.format([ALT_NAME])
    str_list.append(altname_str)    

  if [ROUTE] not in (None,"&amp;lt;NULL&amp;gt;", "", "0"):
    route_str = 'RT# {}'.format([ROUTE])
    str_list.append(route_str)  
    
  if [WIDTH] not in (None, "&amp;lt;NULL&amp;gt;", "", "0"):
    width_str = 'Width = {}'.format([WIDTH])
    str_list.append(width_str)    

  label_str = '\n'.join(str_list)
  return(label_str)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 17:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255427#M65162</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-06T17:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255501#M65165</link>
      <description>&lt;P&gt;Can you give example : "&lt;SPAN&gt;&amp;nbsp;I can't exclude some of the text variables that might show up if that field is a Text rather than Numeric."&amp;nbsp; &amp;nbsp;I'm not sure what you are getting at here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Normally one standardizes the schema (text in text fields, numbers in numeric) to avoid this type of issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 20:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255501#M65165</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-06T20:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255506#M65166</link>
      <description>&lt;P&gt;&amp;nbsp; Well for the Width the original code had&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    if WDTH_TMP:
        if str(WDTH_TMP).strip() not in ("&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","0","Varies"):
            width_str = "&amp;lt;ITA&amp;gt;Width = {}'&amp;lt;/ITA&amp;gt;".format(str(WDTH_TMP))
            str_list.append(width_str)&lt;/LI-CODE&gt;&lt;P&gt;as I need to exclude 0 if it was a numeric field, or exclude text values that show up as "&amp;lt;NULL&amp;gt;, "0", "&amp;lt;Null&amp;gt;" and "Varies".&amp;nbsp; These have been populated in the Width field if the Width was a text field and ones with those values, I didn't want to display at all as a lable if they contained those values...&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 20:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255506#M65166</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-06T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255550#M65171</link>
      <description>&lt;P&gt;OK, since you don't seem to have control of text vs numeric data, lets cast everything to text first.&lt;/P&gt;&lt;P&gt;while at it, might as well .strip() any spaces on either end of the text string.&lt;/P&gt;&lt;P&gt;Now we have varibles (with"1" appended to the end) that are strings with no extra white spaces.&lt;/P&gt;&lt;P&gt;I also changed from variable.format() to f'{variable}' format as it is easier to visualize and keep track of.&lt;/P&gt;&lt;P&gt;Since you don't&amp;nbsp; have control over the data given, lets compare ROUTE1 and WIDTH1 upper case.&amp;nbsp; This way, doesn't matter if the field says "Varies", "varies", "VARIES", etc. will be filtered out.&lt;/P&gt;&lt;P&gt;Now, as far as null values, difficult figureing a way to query them out when then can be text or numeric without actually putting "None" in the label field.&lt;/P&gt;&lt;P&gt;The following seems to work regardless of the input format (text vs number):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):

  NAME1 = str([NAME]).strip()           # assign variable to string with whitespace stripped
  ALT_NAME1 = str([ALT_NAME]).strip()   # assign variable to string with whitespace stripped
  ROUTE1 = str([ROUTE]).strip()         # assign variable to string with whitespace stripped
  WIDTH1 = str([WIDTH]).strip()          # assign variable to string with whitespace stripped
  
  
  str_list = []
  if [NAME]:                                    #Make sure is not empty or can append 'None' to label
    if NAME1 not in ("&amp;lt;NULL&amp;gt;", "", "0"):        # since already string, test if in(values)
      str_list.append(NAME1)                    # append to list if not in the filter list

  if [ALT_NAME]:
     if ALT_NAME1 not in ("&amp;lt;NULL&amp;gt;", "", "0"):
       altname_str = f'({ALT_NAME1})'            # I changed to f'strings as easier to visualize than .format
       str_list.append(altname_str)    

  if [ROUTE]:
     if ROUTE1.upper() not in ("&amp;lt;NULL&amp;gt;", "", "0", "VARIES"):  # Cast compare variable to upper case to test for "VARIES"
       route_str = f'RT# {ROUTE1}'                                 # does not sound like you have much control over data
       str_list.append(route_str)                                  # so casting to upper case will catch other spellings/Case
    
  if [WIDTH]:
     if WIDTH1.upper() not in ("&amp;lt;NULL&amp;gt;", "", "0", "VARIES"):
       width_str = f'Width = {WIDTH1}'
       str_list.append(width_str)    

  label_str = '\n'.join(str_list)
  return(label_str)&lt;/LI-CODE&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 23:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255550#M65171</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-06T23:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255559#M65172</link>
      <description>&lt;P&gt;Yes that works the same with the code I just posted earlier and allows the use of the "&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;".&amp;nbsp; The issue is that it won't allow me to work with Itallics or font changes and that was the issue.&amp;nbsp; I can get away using the code I had, or the one you posted just fine, but I won't have the ability to work with that functionality.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Again, it's more just visually appeasing, and not something I really need, but it would be nice to see if it could work with that sort of thing.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here's the example of what I added to your code for just the Width&amp;nbsp;&lt;EM&gt;(note I had to rename your WIDTH1 to another name as some data comes in with a Width1 as the name, and searching replacing doesn't work as well like that.)&lt;/EM&gt; so I just renamed it to WDTH_TMP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	if WDTH_TMP:
        if str(WDTH_TMP).strip() not in (None,"&amp;lt;NULL&amp;gt;","&amp;lt;Null&amp;gt;","","0",0):
            width_str = "&amp;lt;ITA&amp;gt;Width = {}'&amp;lt;/ITA&amp;gt;".format(str(WDTH_TMP))
            str_list.append(width_str)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the full code using your example and the itallics and font size changes where having a&amp;nbsp;&lt;STRONG&gt;"&amp;amp;"&lt;/STRONG&gt; in the name, still causes that issue displaying the code for itallics, etc as the original issue had.&amp;nbsp; Removing those of course works fine, but I don't get this added visual possibilities is all...&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;(I will be out on vacation for a week so after tomorrow, I'll repond and check out any other suggestions next week.)&lt;/EM&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 23:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255559#M65172</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-06T23:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255569#M65173</link>
      <description>&lt;P&gt;If you use text formatting tags anywhere in the labelstring, you need to put the replace function back in there to replace any '&amp;amp;' with&amp;nbsp;&amp;amp;amp; as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):

  NAME1 = str([NAME]).strip()           # assign variable to string with whitespace stripped
  ALT_NAME1 = str([ALT_NAME]).strip()   # assign variable to string with whitespace stripped
  ROUTE1 = str([ROUTE]).strip()         # assign variable to string with whitespace stripped
  WIDTH1 = str([WIDTH]).strip()          # assign variable to string with whitespace stripped
            
  str_list = []
  if [NAME]:                                    #Make sure is not empty since or can append 'None' to label
     if '&amp;amp;' in NAME1:
            NAME1=NAME1.replace("&amp;amp;","&amp;amp;amp;")
            
     if NAME1 not in ("&amp;lt;NULL&amp;gt;", "", "0"):        # since already string, test if in(values)
      str_list.append(NAME1)                    # append to list if not in the filter list

  if [ALT_NAME]:
     if '&amp;amp;' in ALT_NAME1:
            ALT_NAME1=ALT_NAME1.replace("&amp;amp;","&amp;amp;amp;")
            
     if ALT_NAME1 not in ("&amp;lt;NULL&amp;gt;", "", "0"):
       altname_str = f"&amp;lt;CLR red = '255'&amp;gt;&amp;lt;BOL&amp;gt;&amp;lt;FNT name = 'Arial' style = 'Italic' size = '10'&amp;gt;({ALT_NAME1})&amp;lt;/FNT&amp;gt;&amp;lt;/BOL&amp;gt;&amp;lt;/CLR&amp;gt;"       # I changed to f'strings as easier to visualize than .format
       str_list.append(altname_str)    

  if [ROUTE]:
     if ROUTE1.upper() not in ("&amp;lt;NULL&amp;gt;", "", "0", "VARIES"):  # Cast compare variable to upper case to test for "VARIES"
       route_str = f'RT# {ROUTE1}'                                 # does not sound like you have much control over data
       str_list.append(route_str)                                  # so casting to upper case will catch other spellings/Case
    
  if [WIDTH]:
     if WIDTH1.upper() not in ("&amp;lt;NULL&amp;gt;", "", "0", "VARIES"):
       width_str = f"&amp;lt;UND&amp;gt;&amp;lt;BOL&amp;gt;Width = {WIDTH1}'&amp;lt;/BOL&amp;gt;&amp;lt;/UND&amp;gt;"
       str_list.append(width_str)    

  label_str = '\n'.join(str_list)
  return(label_str)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example shows changing font size, color, and making bold.&amp;nbsp; the &lt;STRONG&gt;&amp;lt;ITA&amp;gt; tag&lt;/STRONG&gt;, even though Pro's documentation says it works, &lt;STRONG&gt;DOES NOT WORK&lt;/STRONG&gt; in either of my versions of Pro (2.9.3 or 3.0.3).&amp;nbsp; However, if you look at line 21, I call out the font as Arial Italic so it displays as such.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_0-1675730425786.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62219iC26E12569C04A95F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RhettZufelt_0-1675730425786.png" alt="RhettZufelt_0-1675730425786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Maybe you could contact tech support and see if there is some trick to getting the &amp;lt;ITA&amp;gt; tag to work, but suspect it is a bug.&amp;nbsp; Otherwise, if you want italics, you will need to find a font that lets you declare it as above.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 00:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255569#M65173</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-07T00:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling using ampersand (&amp;) symbol in text via Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255671#M65189</link>
      <description>&lt;P&gt;Very odd.&amp;nbsp; So I have tried your code and I get it to work, all except when there is only the NAME being displayed.&amp;nbsp; Then it fails with the '&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;' and prints out the following:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"TEST &amp;amp; TEST"&lt;/EM&gt;&amp;nbsp;will show up as&amp;nbsp;&lt;EM&gt;"TEST &amp;amp;amp: TRUE"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Now if I add an ALT_NAME with or without the '&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;' it displays both perfectly fine.&amp;nbsp; Or if I add a ROUTE or WIDTH (other than what is in the exclusion)&lt;/EM&gt; it works perfectly fine.&amp;nbsp; So just the NAME with the '&lt;STRONG&gt;&amp;amp;&lt;/STRONG&gt;' fails.&amp;nbsp; This is getting pretty close to the fix though.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; On another note, being on 3.0.3 myself.&amp;nbsp; I did try with the &lt;STRONG&gt;&amp;lt;ITA&amp;gt;&lt;/STRONG&gt; just to see if I get the same issues you did, and I am getting it working for me the exact way you used&amp;nbsp;&lt;STRONG&gt;&amp;lt;BOL&amp;gt;&lt;/STRONG&gt;.&amp;nbsp; So odd you aren't getting that working like I am...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 13:43:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/labeling-using-ampersand-amp-symbol-in-text-via/m-p/1255671#M65189</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2023-02-07T13:43:41Z</dc:date>
    </item>
  </channel>
</rss>

