<?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 help with condition formatting in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394384#M80205</link>
    <description>&lt;P&gt;Just to make sure I understand your question correctly, I'm going to answer referencing the sample data in the table below.&amp;nbsp; If the expected values are wrong, it might be best for you to share your&amp;nbsp;&lt;EM&gt;old&lt;/EM&gt; label script, so we can match the expected behavior.&lt;/P&gt;&lt;TABLE border="1" width="98.73844676648062%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;TestFeature&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;Row&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Col&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Desired Result&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5-7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;D&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;ERROR: NO VALUES&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Arcade:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var row = $feature.ROW
var col = $feature.COL

// First, see if you have BOTH values
if (!IsEmpty(row) &amp;amp;&amp;amp; !IsEmpty(col))
{
  return row + '-' + col
}
// If you don't have both, but you DO have a column, return it alone.
else if (!IsEmpty(col))
{
  return col
}
// This assumes TestFeature C is valid.  If you don't have both, but you DO have a row, return it alone.
else if (!IsEmpty(row))
{
  return row
}
// This assumes it's possible to have a case like TestFeature D where both values are missing
else
{
  return 'ERROR: NO VALUES'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some notes:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The above assumes that your EMPTY state is an actual &amp;lt;Null&amp;gt; value.&amp;nbsp; If it's a 0, then replace &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;!IsEmpty(row)&lt;/STRONG&gt;&lt;/FONT&gt; with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;row &amp;gt; 0&lt;/STRONG&gt;&lt;/FONT&gt;, and do the same for col.&lt;/LI&gt;&lt;LI&gt;Written the above way, if you get a single value, you won't be able to tell whether it's a row or a column.&amp;nbsp; This might not be a problem if an EMPTY column isn't possible.&amp;nbsp; If it's possible for either one to be empty, then I'd alter your label to indicate which number is which, for example:&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;'R.' + row + '-' + 'C.' + col&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;in line 7 produces "R.5-C.7" for Test Feature A above&lt;/LI&gt;&lt;LI&gt;Or you could just add the&amp;nbsp;&lt;STRONG&gt;R.&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;C.&lt;/STRONG&gt; to lines 12 &amp;amp; 17, for the single values.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Python 3:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel ([ROW], [COL]):
  row = [ROW]
  col = [COL]

  # First, see if you have both values (Test Feature A)
  if row is not None and col is not None:
    return f'{row}-{col}'
  # If you don't have both, see if you have just a column (Test Feature B)
  elif col is not None:
    return f'{col}'
  # If you don't have both, see if you have just a row, assuming that's a valid option.  (Test Feature C)
  elif row is not None:
    return f'{row}'
  # If you've reached this point, you don't have either value. (Test Feature D)
  else:
    return 'ERROR: NO VALUES'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some notes:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;As before, I'm assuming your EMPTY state is a proper &amp;lt;Null&amp;gt;.&amp;nbsp; If it's actually a 0, replace&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;is not None&lt;/STRONG&gt;&lt;/FONT&gt; with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;gt; 0&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/LI&gt;&lt;LI&gt;As before, it might be a good idea to add a prefix specifying row and column, if it's possible for either to be &amp;lt;Null&amp;gt;.&lt;OL&gt;&lt;LI&gt;Line 7 becomes&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;return f'R.{row}-C.{col}'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Line 10 becomes&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;return f'R.{row}'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Line 13 becomes&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;return f'C.{col}'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Mon, 11 Mar 2024 21:46:47 GMT</pubDate>
    <dc:creator>MErikReedAugusta</dc:creator>
    <dc:date>2024-03-11T21:46:47Z</dc:date>
    <item>
      <title>Label help with condition formatting</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394272#M80186</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am unable to figure out how I can format labels using ArcCade or Python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 fields (row, col). Row can be empty at some location. I want to show col only. How to setup a condition.&lt;/P&gt;&lt;P&gt;It displays "-col1" when row is empty. My syntax is&amp;nbsp;&lt;/P&gt;&lt;P&gt;$feature.ROW + '-' + $feature.COL&lt;/P&gt;&lt;P&gt;please help!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 18:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394272#M80186</guid>
      <dc:creator>JummaKhan</dc:creator>
      <dc:date>2024-03-11T18:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Label help with condition formatting</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394329#M80196</link>
      <description>&lt;P&gt;I think this Arcade label expresion will work if the ROW field has 0 (zero) values in it.&lt;BR /&gt;&lt;BR /&gt;if ($feature.ROW == 0){&lt;BR /&gt;return $feature.COL}&lt;BR /&gt;else&lt;BR /&gt;if ($feature.ROW &amp;gt; 0){&lt;BR /&gt;return $feature.NAME + "-" + $feature.ACRES}&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 19:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394329#M80196</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2024-03-11T19:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Label help with condition formatting</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394384#M80205</link>
      <description>&lt;P&gt;Just to make sure I understand your question correctly, I'm going to answer referencing the sample data in the table below.&amp;nbsp; If the expected values are wrong, it might be best for you to share your&amp;nbsp;&lt;EM&gt;old&lt;/EM&gt; label script, so we can match the expected behavior.&lt;/P&gt;&lt;TABLE border="1" width="98.73844676648062%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;TestFeature&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;Row&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Col&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;STRONG&gt;Desired Result&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5-7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;D&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&amp;lt;Null&amp;gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;ERROR: NO VALUES&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Arcade:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var row = $feature.ROW
var col = $feature.COL

// First, see if you have BOTH values
if (!IsEmpty(row) &amp;amp;&amp;amp; !IsEmpty(col))
{
  return row + '-' + col
}
// If you don't have both, but you DO have a column, return it alone.
else if (!IsEmpty(col))
{
  return col
}
// This assumes TestFeature C is valid.  If you don't have both, but you DO have a row, return it alone.
else if (!IsEmpty(row))
{
  return row
}
// This assumes it's possible to have a case like TestFeature D where both values are missing
else
{
  return 'ERROR: NO VALUES'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some notes:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The above assumes that your EMPTY state is an actual &amp;lt;Null&amp;gt; value.&amp;nbsp; If it's a 0, then replace &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;!IsEmpty(row)&lt;/STRONG&gt;&lt;/FONT&gt; with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;row &amp;gt; 0&lt;/STRONG&gt;&lt;/FONT&gt;, and do the same for col.&lt;/LI&gt;&lt;LI&gt;Written the above way, if you get a single value, you won't be able to tell whether it's a row or a column.&amp;nbsp; This might not be a problem if an EMPTY column isn't possible.&amp;nbsp; If it's possible for either one to be empty, then I'd alter your label to indicate which number is which, for example:&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;'R.' + row + '-' + 'C.' + col&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;in line 7 produces "R.5-C.7" for Test Feature A above&lt;/LI&gt;&lt;LI&gt;Or you could just add the&amp;nbsp;&lt;STRONG&gt;R.&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;C.&lt;/STRONG&gt; to lines 12 &amp;amp; 17, for the single values.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Python 3:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def FindLabel ([ROW], [COL]):
  row = [ROW]
  col = [COL]

  # First, see if you have both values (Test Feature A)
  if row is not None and col is not None:
    return f'{row}-{col}'
  # If you don't have both, see if you have just a column (Test Feature B)
  elif col is not None:
    return f'{col}'
  # If you don't have both, see if you have just a row, assuming that's a valid option.  (Test Feature C)
  elif row is not None:
    return f'{row}'
  # If you've reached this point, you don't have either value. (Test Feature D)
  else:
    return 'ERROR: NO VALUES'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Some notes:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;As before, I'm assuming your EMPTY state is a proper &amp;lt;Null&amp;gt;.&amp;nbsp; If it's actually a 0, replace&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;is not None&lt;/STRONG&gt;&lt;/FONT&gt; with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;gt; 0&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/LI&gt;&lt;LI&gt;As before, it might be a good idea to add a prefix specifying row and column, if it's possible for either to be &amp;lt;Null&amp;gt;.&lt;OL&gt;&lt;LI&gt;Line 7 becomes&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;return f'R.{row}-C.{col}'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Line 10 becomes&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;return f'R.{row}'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Line 13 becomes&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;return f'C.{col}'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 11 Mar 2024 21:46:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-help-with-condition-formatting/m-p/1394384#M80205</guid>
      <dc:creator>MErikReedAugusta</dc:creator>
      <dc:date>2024-03-11T21:46:47Z</dc:date>
    </item>
  </channel>
</rss>

