<?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: Converting VBScript Label Expression to Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663957#M74875</link>
    <description>&lt;P&gt;Had to do some minor tweaks but this worked! Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2025 16:05:40 GMT</pubDate>
    <dc:creator>sawillis96</dc:creator>
    <dc:date>2025-11-06T16:05:40Z</dc:date>
    <item>
      <title>Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663531#M74863</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am having trouble trying to convert VBScript label expressions to Python. I've tried running them through AI to help convert, but no luck. Is there a way within the ArcGIS Pro software to complete this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 13:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663531#M74863</guid>
      <dc:creator>sawillis96</dc:creator>
      <dc:date>2025-11-05T13:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663572#M74864</link>
      <description>&lt;P&gt;It would help if you posted what you are trying to convert.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 15:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663572#M74864</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2025-11-05T15:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663760#M74871</link>
      <description>&lt;P&gt;Best way is to just manually port them over, but we can't help without the original script as Tony said&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 22:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663760#M74871</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2025-11-05T22:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663828#M74873</link>
      <description>&lt;P&gt;I was just curious if there was a method within ArcGIS Pro to automatically convert it. But here is the VBS code I'm working with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function FindLabel ( [F1], [Total_VOC_Jun_2017], [Total_VOC_Notes_Jun_2017], [Total_VOC_Oct_2017], [Total_VOC_Notes_Oct_2017], [Total_VOCs_2019_08], [Total_VOCs_Notes_2019_08], [Total_VOC_April_2022], [Total_VOC_Notes_April_2022])&lt;BR /&gt;FindLabel="&amp;lt;BOL&amp;gt;&amp;lt;UND&amp;gt;" &amp;amp; [F1] &amp;amp; "&amp;lt;/UND&amp;gt;&amp;lt;/BOL&amp;gt;"&lt;BR /&gt;FindLabel = FindLabel &amp;amp; vbNewLine &amp;amp; LabelBlockLineFormatter([Total_VOC_Notes_Jun_2017], [Total_VOC_Jun_2017])&lt;BR /&gt;FindLabel = FindLabel &amp;amp; vbNewLine &amp;amp; LabelBlockLineFormatter([Total_VOC_Notes_Oct_2017], [Total_VOC_Oct_2017])&lt;BR /&gt;FindLabel = FindLabel &amp;amp; vbNewLine &amp;amp; LabelBlockLineFormatter([Total_VOCs_Notes_2019_08], [Total_VOCs_2019_08])&lt;BR /&gt;FindLabel = FindLabel &amp;amp; vbNewLine &amp;amp; LabelBlockLineFormatter([Total_VOC_Notes_April_2022], [Total_VOC_April_2022])&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Function LabelBlockLineFormatter([Descripter], [Value])&lt;BR /&gt;if([Descripter] = "Above Criteria") then&lt;BR /&gt;LabelBlockLineFormatter = "&amp;lt;CLR red = '255'&amp;gt;" &amp;amp; [Value] &amp;amp; "&amp;lt;/CLR&amp;gt;"&lt;BR /&gt;elseif ([Value] = 0) then&lt;BR /&gt;LabelBlockLineFormatter = "ND"&lt;BR /&gt;elseif isnull([Value]) then&lt;BR /&gt;LabelBlockLineFormatter = "NS"&lt;BR /&gt;else&lt;BR /&gt;LabelBlockLineFormatter = [Value]&lt;BR /&gt;end if&lt;BR /&gt;End Function&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 12:42:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663828#M74873</guid>
      <dc:creator>sawillis96</dc:creator>
      <dc:date>2025-11-06T12:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663946#M74874</link>
      <description>&lt;P&gt;Untested but try something like this,&amp;nbsp;&lt;/P&gt;&lt;P&gt;python phrase,&lt;/P&gt;&lt;LI-CODE lang="c"&gt;def LabelBlockLineFormatter(Descripter, Value):
    if Descripter == "Above Criteria":
        return f"&amp;lt;CLR red='255'&amp;gt;{Value}&amp;lt;/CLR&amp;gt;"
    elif Value == 0:
        return "ND"
    elif Value is None or Value == "&amp;lt;Null&amp;gt;":
        return "NS"
    else:
        return str(Value)

def FindLabel(F1, Total_VOC_Jun_2017, Total_VOC_Notes_Jun_2017, 
              Total_VOC_Oct_2017, Total_VOC_Notes_Oct_2017, 
              Total_VOCs_2019_08, Total_VOCs_Notes_2019_08, 
              Total_VOC_April_2022, Total_VOC_Notes_April_2022):

    label = f"&amp;lt;BOL&amp;gt;&amp;lt;UND&amp;gt;{F1}&amp;lt;/UND&amp;gt;&amp;lt;/BOL&amp;gt;"
    label += "\n" + LabelBlockLineFormatter(Total_VOC_Notes_Jun_2017, Total_VOC_Jun_2017)
    label += "\n" + LabelBlockLineFormatter(Total_VOC_Notes_Oct_2017, Total_VOC_Oct_2017)
    label += "\n" + LabelBlockLineFormatter(Total_VOCs_Notes_2019_08, Total_VOCs_2019_08)
    label += "\n" + LabelBlockLineFormatter(Total_VOC_Notes_April_2022, Total_VOC_April_2022)

    return label&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expression line&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FindLabel(!F1!, !Total_VOC_Jun_2017!, !Total_VOC_Notes_Jun_2017!, 
          !Total_VOC_Oct_2017!, !Total_VOC_Notes_Oct_2017!, 
          !Total_VOCs_2019_08!, !Total_VOCs_Notes_2019_08!, 
          !Total_VOC_April_2022!, !Total_VOC_Notes_April_2022!)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 15:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663946#M74874</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2025-11-06T15:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663957#M74875</link>
      <description>&lt;P&gt;Had to do some minor tweaks but this worked! Thank you so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 16:05:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663957#M74875</guid>
      <dc:creator>sawillis96</dc:creator>
      <dc:date>2025-11-06T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting VBScript Label Expression to Python</title>
      <link>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663970#M74876</link>
      <description>&lt;P&gt;Right on! Happy to help!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 16:36:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-vbscript-label-expression-to-python/m-p/1663970#M74876</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2025-11-06T16:36:31Z</dc:date>
    </item>
  </channel>
</rss>

