<?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 in Arcade based on domain value? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051328#M40235</link>
    <description>&lt;P&gt;Thanks, Josh,&lt;/P&gt;&lt;P&gt;To clarify, I am looking to label the Situs Number of the address where the description of the address is single. We label different addresses in different ways that we are trying to convert from VB Script into Arcade.&amp;nbsp; The example below shows how we labeled single addresses, then how we labeled duplexes in the same label class.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Function FindLabel ([Description], [SitusNum], [BuildingNum], [UnitNum])
myDescrip = [Description]
myBldgVal = [BuildingNum] 
myUnitVal = [UnitNum] 

  Select Case myDescrip
    Case "SINGLE"
        FindLabel = [SitusNum]
    Case "DUPLEX"
        if isNull(myUnitVal) or myUnitVal = "" or myUnitVal = " " then
           FindLabel = [SitusNum]      
           else
            FindLabel = [SitusNum] &amp;amp; " - " &amp;amp;  [UnitNum]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 15:01:02 GMT</pubDate>
    <dc:creator>Brian_McLeer</dc:creator>
    <dc:date>2021-04-26T15:01:02Z</dc:date>
    <item>
      <title>Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051316#M40232</link>
      <description>&lt;P&gt;I am trying to label a feature based on if it is in particular criteria. There are address points where we want to label the Situs Number (SitusNum) based only if the Description of the address is 'SINGLE'. The code below is obviously basic but I am wondering how I can apply a when or if statement to below. We will be using multiple expressions in the same label class, so applying a SQL filter will not be enough.&amp;nbsp;&lt;/P&gt;&lt;P&gt;$feature.SitusNum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL Statement to make it so it labels only where the description is NULL:&lt;/P&gt;&lt;P&gt;Description = 'SINGLE'&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051316#M40232</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-04-26T14:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051323#M40234</link>
      <description>&lt;P&gt;Maybe it's just me, but it's not entirely clear what your end goal is here based on the code you've shared. Can you elaborate on what the "multiple expressions" are, and give an example of what the expected output might be?&lt;/P&gt;&lt;P&gt;If you're just looking for how to implement a series of "if... else if... else" statements,&lt;A href="https://developers.arcgis.com/arcade/guide/logic/" target="_self"&gt; the Arcade guide&lt;/A&gt; details this thoroughly.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051323#M40234</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-04-26T14:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051328#M40235</link>
      <description>&lt;P&gt;Thanks, Josh,&lt;/P&gt;&lt;P&gt;To clarify, I am looking to label the Situs Number of the address where the description of the address is single. We label different addresses in different ways that we are trying to convert from VB Script into Arcade.&amp;nbsp; The example below shows how we labeled single addresses, then how we labeled duplexes in the same label class.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Function FindLabel ([Description], [SitusNum], [BuildingNum], [UnitNum])
myDescrip = [Description]
myBldgVal = [BuildingNum] 
myUnitVal = [UnitNum] 

  Select Case myDescrip
    Case "SINGLE"
        FindLabel = [SitusNum]
    Case "DUPLEX"
        if isNull(myUnitVal) or myUnitVal = "" or myUnitVal = " " then
           FindLabel = [SitusNum]      
           else
            FindLabel = [SitusNum] &amp;amp; " - " &amp;amp;  [UnitNum]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:01:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051328#M40235</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-04-26T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051336#M40236</link>
      <description>&lt;P&gt;A straight "translation" of that code might look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;var d = $feature.Description
var s = $feature.SitusNum
var u = $feature.myUnitVal

if(d == 'SINGLE'){
    return s
} else if(d == 'DUPLEX'){
    if(IsEmpty(u)){
        return s
    } else{
        return s + ' - ' + u
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note the function &lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#isempty" target="_self"&gt;&lt;STRONG&gt;IsEmpty&lt;/STRONG&gt;&lt;/A&gt; returns &lt;STRONG&gt;True&lt;/STRONG&gt; if the value is null &lt;EM&gt;or &lt;/EM&gt;an empty string.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051336#M40236</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-04-26T15:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051343#M40237</link>
      <description>&lt;P&gt;So when I enter that, it shows that there is a reserved keyword on line 10.&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051343#M40237</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-04-26T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051349#M40238</link>
      <description>&lt;P&gt;There's a missing "}" before the "else"&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051349#M40238</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-04-26T15:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051362#M40242</link>
      <description>&lt;P&gt;Thanks, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt; ! I'm used to interfaces that auto-insert my braces and brackets, and that one got by me. I should write it up in an IDE first to catch those sorts of mistakes.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051362#M40242</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-04-26T15:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051364#M40244</link>
      <description>&lt;P&gt;Thank you both for your assistance on this, greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:43:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051364#M40244</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-04-26T15:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Label in Arcade based on domain value?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051506#M40262</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;, would you have any knowledge as to how to treat labeling an address with the same description based on the code snippets from above. Below, if a feature is a business, I am trying to label the building number only, not the situs number if a building number exists. In the same scope of work, I am also trying to label a business on the unit number only if a unit number exists.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;}else if(d == 'BUSINESS'){
    if(IsEmpty(u)){
        return s}
    else{
        return u}
} else if(d == 'BUSINESS'){
    if(IsEmpty(b)){
        return s}
    else{
        return b}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 20:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/label-in-arcade-based-on-domain-value/m-p/1051506#M40262</guid>
      <dc:creator>Brian_McLeer</dc:creator>
      <dc:date>2021-04-26T20:56:21Z</dc:date>
    </item>
  </channel>
</rss>

