<?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: Complicated Label Expression in ArcGIS Parcel Fabric Questions</title>
    <link>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477346#M1709</link>
    <description>&lt;P&gt;Is the value literally "&amp;lt;Null&amp;gt;"? Regardless, we can filter for the literal string, too. Be careful that you don't use a function name as a variable, as is the case with &lt;STRONG&gt;Number&lt;/STRONG&gt; here.&lt;/P&gt;&lt;P&gt;I like using arrays for complex functions, because they can easily be filtered or concatenated. Looking at the name / number section, it looks like the text "ESMT" always comes after name, or it comes by itself if there is no name. (Is it skipped when there's no name, just a number?)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function NotEmpty(x) { return !IsEmpty(x) &amp;amp;&amp;amp; x != '&amp;lt;Null&amp;gt;' }

// name and number, filtered out if empty
var name_num = Filter([
  $feature['Name'],
  'ESMT',
  $feature['Number']
], NotEmpty)

return Concatenate(name_num, ' ')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For cases when there's a single condition, as in the Width expression, you can use &lt;STRONG&gt;Iif&lt;/STRONG&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var width_label = Iif(
  NotEmpty($feature['Width'],
  `${$feature['Width']} FT WIDE`,
  Null
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is all together.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function NotEmpty(x) { return !IsEmpty(x) &amp;amp;&amp;amp; x != '&amp;lt;Null&amp;gt;' }

// name and number, filtered out if empty
var name_num = Filter([
  $feature['Name'],
  'ESMT',
  $feature['Number']
], NotEmpty)

// join valid attributes with spaces
var name_num_label =  Concatenate(name_num, ' ')

// include "FT WIDE" when width is present, otherwise null
var width_label = Iif(
  NotEmpty($feature['Width']),
  `${$feature['Width']} FT WIDE`,
  null
)

// array of area values, empty values filtered out
var area_arr = Filter([
  Iif(
    NotEmpty($feature['sf']),
    `${Text($feature['sf'], '#,###.##')} sf`,
    null
  ),
  Iif(
    NotEmpty($feature['ac']),
    `${Text($feature['ac'], '#,###.##')} ac`,
    null
  )
], NotEmpty)

// join area values with space and brackets; if no values in area, omit entirely
var area_label = Iif(
  Count(area_arr) &amp;gt; 0,
  `[${Concatenate(area_arr, ' ')}]`,
  null
)

// all labels in single array, filter out empties
var final_arr = Filter([
  name_num_label,
  width_label,
  area_label
], NotEmpty)

// output labels one per line; if &amp;lt;br&amp;gt; doesn't work, try '\n'
return Concatenate(final_arr, '&amp;lt;br&amp;gt;')&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 22 May 2024 21:42:40 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2024-05-22T21:42:40Z</dc:date>
    <item>
      <title>Complicated Label Expression</title>
      <link>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477308#M1708</link>
      <description>&lt;P&gt;I have here a new ArcPro Parcel Fabric (3.1.x and PF v5) in an Enterprise environment with Versioned editing.&lt;/P&gt;&lt;P&gt;We have a complicated attribute setup and I am attempting to label these according to the way the editors would like to see them.&lt;/P&gt;&lt;P&gt;Fields: Name, Number, Width, sf, and ac.&lt;/P&gt;&lt;P&gt;We are not using the default StatedArea/StatedAreaUnits fields because our legal descriptions frequently contain both square feet and acres and we want to reflect that in our Tax Map Sheets.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ESMTLabel.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105018i5CD6FF5ED8F267CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ESMTLabel.jpg" alt="ESMTLabel.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;DRAINAGE AND SEWER ESMT B&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;MULTI-USE ESMT 1-B (10 FT WIDE)&lt;/LI&gt;&lt;LI&gt;ESMT&lt;/LI&gt;&lt;LI&gt;DRAINAGE ESMT D (4 FT WIDE) *NEWLINE* [260 sf or 0.04 ac]&lt;/LI&gt;&lt;LI&gt;SEWER AND WATER ESMT (5 FT WIDE) *NEWLINE* [100 sf]&lt;/LI&gt;&lt;LI&gt;SEWER AND WATER ESMT *NEWLINE* [1.36 ac]&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have 3 separate scripts right now: 1 for Name and Number, 1 for Width, and one for Area.&lt;/P&gt;&lt;P&gt;(See below)&lt;/P&gt;&lt;P&gt;I'm so very close but could use some assistance on combining them into one if possible.&lt;/P&gt;&lt;P&gt;There is also one issue for the Name/Number portion.. I can't figure out how to prevent "&amp;lt;Null&amp;gt;" in the Name.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Esmt_attributes.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105025i1142648EE0336A01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Esmt_attributes.jpg" alt="Esmt_attributes.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Name/Number&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var Name = $feature["Name"];&lt;BR /&gt;var Number = $feature["Number"];&lt;BR /&gt;var label = "";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//Check if Name and Number are empty&lt;BR /&gt;if (IsEmpty(Name) &amp;amp;&amp;amp; IsEmpty(Number)) {&lt;BR /&gt;// If all are empty return ESMT&lt;BR /&gt;return "ESMT";&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;// If Name or Number have a value, return their values&lt;BR /&gt;if (!IsEmpty(Name)) {&lt;BR /&gt;label += Text(Name) + " ESMT";&lt;BR /&gt;}&lt;BR /&gt;if (!IsEmpty(Number)) {&lt;BR /&gt;if (label != "") {&lt;BR /&gt;label += " " + Text(Number);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Width&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var Width = $feature["Width"];&lt;BR /&gt;var label = "";&lt;/P&gt;&lt;P&gt;//Check if Width field is empty&lt;BR /&gt;if (IsEmpty(Width)){&lt;BR /&gt;return label;&lt;BR /&gt;} else {&lt;BR /&gt;//if Width field is not empty, return value with parentheses and 'FT WIDE'&lt;BR /&gt;if (!IsEmpty(Width)){&lt;BR /&gt;label = "(" + Text(Width) + " FT WIDE)"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Area&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var sf = $feature["sf"];&lt;BR /&gt;var ac = $feature["ac"];&lt;BR /&gt;var label = "";&lt;BR /&gt;Ar&lt;BR /&gt;// Check if both sf and ac are empty&lt;BR /&gt;if (IsEmpty(sf) &amp;amp;&amp;amp; IsEmpty(ac)) {&lt;BR /&gt;return label;&lt;BR /&gt;} else {&lt;BR /&gt;// If either sf or ac have a value, return their values with their respective suffixes&lt;BR /&gt;if (!IsEmpty(sf)) {&lt;BR /&gt;label += Text(sf, "#,###.##") + " sf";&lt;BR /&gt;}&lt;BR /&gt;if (!IsEmpty(ac)) {&lt;BR /&gt;if (label != "") {&lt;BR /&gt;label += " or ";&lt;BR /&gt;}&lt;BR /&gt;label += Text(ac, "#,###.##") + " ac";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return "[" + label + "]";&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 20:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477308#M1708</guid>
      <dc:creator>ElisseDeleissegues1</dc:creator>
      <dc:date>2024-05-22T20:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Label Expression</title>
      <link>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477346#M1709</link>
      <description>&lt;P&gt;Is the value literally "&amp;lt;Null&amp;gt;"? Regardless, we can filter for the literal string, too. Be careful that you don't use a function name as a variable, as is the case with &lt;STRONG&gt;Number&lt;/STRONG&gt; here.&lt;/P&gt;&lt;P&gt;I like using arrays for complex functions, because they can easily be filtered or concatenated. Looking at the name / number section, it looks like the text "ESMT" always comes after name, or it comes by itself if there is no name. (Is it skipped when there's no name, just a number?)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function NotEmpty(x) { return !IsEmpty(x) &amp;amp;&amp;amp; x != '&amp;lt;Null&amp;gt;' }

// name and number, filtered out if empty
var name_num = Filter([
  $feature['Name'],
  'ESMT',
  $feature['Number']
], NotEmpty)

return Concatenate(name_num, ' ')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For cases when there's a single condition, as in the Width expression, you can use &lt;STRONG&gt;Iif&lt;/STRONG&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var width_label = Iif(
  NotEmpty($feature['Width'],
  `${$feature['Width']} FT WIDE`,
  Null
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is all together.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function NotEmpty(x) { return !IsEmpty(x) &amp;amp;&amp;amp; x != '&amp;lt;Null&amp;gt;' }

// name and number, filtered out if empty
var name_num = Filter([
  $feature['Name'],
  'ESMT',
  $feature['Number']
], NotEmpty)

// join valid attributes with spaces
var name_num_label =  Concatenate(name_num, ' ')

// include "FT WIDE" when width is present, otherwise null
var width_label = Iif(
  NotEmpty($feature['Width']),
  `${$feature['Width']} FT WIDE`,
  null
)

// array of area values, empty values filtered out
var area_arr = Filter([
  Iif(
    NotEmpty($feature['sf']),
    `${Text($feature['sf'], '#,###.##')} sf`,
    null
  ),
  Iif(
    NotEmpty($feature['ac']),
    `${Text($feature['ac'], '#,###.##')} ac`,
    null
  )
], NotEmpty)

// join area values with space and brackets; if no values in area, omit entirely
var area_label = Iif(
  Count(area_arr) &amp;gt; 0,
  `[${Concatenate(area_arr, ' ')}]`,
  null
)

// all labels in single array, filter out empties
var final_arr = Filter([
  name_num_label,
  width_label,
  area_label
], NotEmpty)

// output labels one per line; if &amp;lt;br&amp;gt; doesn't work, try '\n'
return Concatenate(final_arr, '&amp;lt;br&amp;gt;')&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 May 2024 21:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477346#M1709</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-05-22T21:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Complicated Label Expression</title>
      <link>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477894#M1710</link>
      <description>&lt;LI-CODE lang="python"&gt;function NotEmpty(x) { return !IsEmpty(x) &amp;amp;&amp;amp; x != '&amp;lt;Null&amp;gt;' }

// name and number, filtered out if empty
var name_num = Filter([
  $feature['Name'],
  'ESMT',
  $feature['Number']
], NotEmpty)

// join valid attributes with spaces
var name_num_label =  Concatenate(name_num, ' ')

// include "FT WIDE" when width is present, otherwise null
var width_label = Iif(
  NotEmpty($feature['Width']),
  `(${$feature['Width']} FT WIDE)`,
  null
)

// array of area values, empty values filtered out
var area_arr = Filter([
  Iif(
    NotEmpty($feature['sf']),
    `${Text($feature['sf'], '#,###.##')} sf`,
    null
  ),
  Iif(
    NotEmpty($feature['ac']),
    `${Text($feature['ac'], '#,###.##')} ac`,
    null
  )
], NotEmpty)

// join area values with space and brackets; if no values in area, omit entirely
var area_label = Iif(
  Count(area_arr) &amp;gt; 0,
  `[${Concatenate(area_arr, ' or ', ' ')}]`,
  null
)

// all labels in single array, filter out empties
var final_arr = Filter([
  name_num_label,
  width_label,
  area_label
], NotEmpty)

// output labels one per line; if &amp;lt;br&amp;gt; doesn't work, try '\n'
return Concatenate(final_arr, '\n')&lt;/LI-CODE&gt;&lt;P&gt;That's a completely different language! lol&lt;/P&gt;&lt;P&gt;I made a few small changes adding parentheses to `(${$feature['Width']} FT WIDE)`, and "or" to the area concatenation `[${Concatenate(area_arr, ' or ', ' ')}]`,&lt;/P&gt;&lt;P&gt;and this works exactly right!! &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is what my users want to see and I thank you very much&lt;/P&gt;&lt;P&gt;I do wish I was better at these things....but I'm learning&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 18:48:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-parcel-fabric-questions/complicated-label-expression/m-p/1477894#M1710</guid>
      <dc:creator>ElisseDeleissegues1</dc:creator>
      <dc:date>2024-05-23T18:48:03Z</dc:date>
    </item>
  </channel>
</rss>

