<?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: ArcGIS Pro 2.9 Advanced label expression / code block question in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136095#M50372</link>
    <description>&lt;LI-CODE lang="python"&gt;!your_fld! if !your_fld! in ["Tom Thumb", "William Tell"] else " "&lt;/LI-CODE&gt;&lt;P&gt;maybe?&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jan 2022 00:14:44 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-01-22T00:14:44Z</dc:date>
    <item>
      <title>ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136044#M50361</link>
      <description>&lt;P&gt;Anyone know what on earth is wrong with this label expression code block?&amp;nbsp; Once I get the error fixed, how on earth do I invoke it?&amp;nbsp; ArcMAP had the pre logic script code bit separate from the expression, but now its not, how does it work now in Pro? (the help files seem to totally gloss it over)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KeithAddison1_1-1642801533300.png" style="width: 358px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32016i46980935B1189242/image-dimensions/358x502?v=v2" width="358" height="502" role="button" title="KeithAddison1_1-1642801533300.png" alt="KeithAddison1_1-1642801533300.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 21:45:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136044#M50361</guid>
      <dc:creator>KeithAddison1</dc:creator>
      <dc:date>2022-01-21T21:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136064#M50363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if needs == for equal in python.&lt;/P&gt;&lt;P&gt;Greetings Karsten&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 22:08:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136064#M50363</guid>
      <dc:creator>KarstenRank</dc:creator>
      <dc:date>2022-01-21T22:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136065#M50364</link>
      <description>&lt;P&gt;Your example doesn't look like valid Python?&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel ( [UNIX Time] ):
    if [UNIX Time] in ["TOM THUMB", "WILLIAM TELL"]:
        return [UNIX Time]
    else:
        return [UNIX Time]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 22:09:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136065#M50364</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-01-21T22:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136066#M50365</link>
      <description>&lt;P&gt;A single "=" in Python is very different from "==", which is what you want to do to check the value of a variable. You also need to give both conditions in full. Anything after the "OR" needs to evaluate to a boolean on its own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel ([NAME1]):
    if [NAME1] == "TOM THUMB" OR [NAME1] == "WILLIAM TELL":
        return [NAME1]
    else:
        return " "&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, you can check if the field is in a list of "match" values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel ([NAME1]):
    if [NAME1] in ["TOM THUMB", "WILLIAM TELL"]:
        return [NAME1]
    else:
        return " "&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 22:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136066#M50365</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-21T22:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136091#M50371</link>
      <description>&lt;P&gt;Please post code (and code block expressions) as formatted code not screenshots, makes it so much easier for people to read, copy, test and then hopefully answer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/bc-p/1135971" target="_blank"&gt;https://community.esri.com/t5/python-blog/code-formatting-the-community-version/bc-p/1135971&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 23:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136091#M50371</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-01-21T23:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.9 Advanced label expression / code block question</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136095#M50372</link>
      <description>&lt;LI-CODE lang="python"&gt;!your_fld! if !your_fld! in ["Tom Thumb", "William Tell"] else " "&lt;/LI-CODE&gt;&lt;P&gt;maybe?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 00:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-9-advanced-label-expression-code/m-p/1136095#M50372</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-01-22T00:14:44Z</dc:date>
    </item>
  </channel>
</rss>

