<?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: Arcade - Some Labels Won't Show in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524564#M87206</link>
    <description>&lt;P&gt;The reason you're not getting any results for a name less than four words is that you're using specific index values in the split array that wouldn't exist in lines 4 and 6 for shorter words. This should work regardless of the number of words in the name. The third line will contain anything more than four words.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Var FtName = $feature['Name'];
var FtSplit = Split(FtName, ' ')
Var Counter = Count(FtSplit)
When (Counter &amp;lt; 4, FtName,
      Counter == 4, Concatenate(Slice(Ftsplit,0, 2), ' ') + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 2, 4), ' '),
      Concatenate(Slice(Ftsplit,0, 2), ' ') + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 2, 4), ' ')  + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 4), ' ')
);&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 20 Aug 2024 17:44:26 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-08-20T17:44:26Z</dc:date>
    <item>
      <title>Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524498#M87201</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FaithBest_0-1724170945016.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112941i1658743A41D86FF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FaithBest_0-1724170945016.png" alt="FaithBest_0-1724170945016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Var FtName = $feature["NAME"]
var FtSplit = Split(FtName, ' ', -1)
Var Counter = Count(FtSplit)
var FirstLine = FtSplit[0] + ' ' + FtSplit[1]
Var SecondLine = Replace(FtName, FirstLine, '')
Var SecondLine2 = FtSplit[2] + ' ' + FtSplit[3]
Var ThirdLine = Replace(SecondLine, SecondLine2, '')

If (Counter &amp;gt; 3){
    If(Counter &amp;gt; 4){
        Var output2 = FirstLine + TextFormatting.NewLine + SecondLine2 + TextFormatting.NewLine + ThirdLine
        Return output2
    }else{
        Var output1 = FirstLine + TextFormatting.NewLine + SecondLine
        Return output1 
    }
}else{
    Return $feature["NAME"]
}&lt;/LI-CODE&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I probably have something wrong with my Arcade expression I just can't figure out what.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use this code, all labels with less than 3 words disappear and will not show. I am trying to create an expression that can handle varied number of word labels and create a stacked view for the labels so when they are published to Portal and viewed in Map Viewer they look a little nicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has any suggestions or sees the problem, help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 17:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524498#M87201</guid>
      <dc:creator>FaithBest</dc:creator>
      <dc:date>2024-08-20T17:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524520#M87202</link>
      <description>&lt;P&gt;When asking a question about code, you should &lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;insert the code&lt;/A&gt; using the "Insert/edit code sample" button instead of posting an image of the code. It makes it easier to duplicate it in our testing environments.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 16:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524520#M87202</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-20T16:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524532#M87203</link>
      <description>&lt;P&gt;Oh Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Var FtName = $feature["NAME"]
var FtSplit = Split(FtName, ' ', -1)
Var Counter = Count(FtSplit)
var FirstLine = FtSplit[0] + ' ' + FtSplit[1]
Var SecondLine = Replace(FtName, FirstLine, '')
Var SecondLine2 = FtSplit[2] + ' ' + FtSplit[3]
Var ThirdLine = Replace(SecondLine, SecondLine2, '')

If (Counter &amp;gt; 3){
    If(Counter &amp;gt; 4){
        Var output2 = FirstLine + TextFormatting.NewLine + SecondLine2 + TextFormatting.NewLine + ThirdLine
        Return output2
    }else{
        Var output1 = FirstLine + TextFormatting.NewLine + SecondLine
        Return output1 
    }
}else{
    Return $feature["NAME"]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 17:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524532#M87203</guid>
      <dc:creator>FaithBest</dc:creator>
      <dc:date>2024-08-20T17:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524555#M87204</link>
      <description>&lt;P&gt;This seems to work regardless of the number of words:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Var FtName = Replace($feature["NAME"], ' ', TextFormatting.NewLine)
return FtName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 17:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524555#M87204</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-08-20T17:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524562#M87205</link>
      <description>&lt;P&gt;There's a lot of stuff going on that I don't think is necessary. When you're putting your line items back together, you can just use &lt;STRONG&gt;Concatenate &lt;/STRONG&gt;and &lt;STRONG&gt;Slice&lt;/STRONG&gt; to get the array values you want.&lt;/P&gt;&lt;P&gt;And we can actually get rid of the counter, too! Slice will return empty strings, so we can just check the length of those strings.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var FtName = $feature["NAME"];
var FtSplit = Split(FtName, " ", -1);

var FirstLine = Concatenate(Slice(FtSplit, 0, 2), " ");
var SecondLine = Concatenate(Slice(FtSplit, 2, 4), " ");
var ThirdLine = Concatenate(Slice(FtSplit, 4), " ");

if (Count(ThirdLine) &amp;gt; 0) {
  return `${FirstLine}\n${SecondLine}\n${ThirdLine}`
} else if (Count(SecondLine) &amp;gt; 0) {
  return `${FirstLine}\n${SecondLine}`
} else {
  return $feature['NAME']
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1724175691902.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112959iDE2004AEBDE1BC28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1724175691902.png" alt="jcarlson_1-1724175691902.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_2-1724175709170.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112960i8036E71C103C752E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_2-1724175709170.png" alt="jcarlson_2-1724175709170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_3-1724175732127.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112961i68810F508D323952/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_3-1724175732127.png" alt="jcarlson_3-1724175732127.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 17:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524562#M87205</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-08-20T17:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Some Labels Won't Show</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524564#M87206</link>
      <description>&lt;P&gt;The reason you're not getting any results for a name less than four words is that you're using specific index values in the split array that wouldn't exist in lines 4 and 6 for shorter words. This should work regardless of the number of words in the name. The third line will contain anything more than four words.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Var FtName = $feature['Name'];
var FtSplit = Split(FtName, ' ')
Var Counter = Count(FtSplit)
When (Counter &amp;lt; 4, FtName,
      Counter == 4, Concatenate(Slice(Ftsplit,0, 2), ' ') + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 2, 4), ' '),
      Concatenate(Slice(Ftsplit,0, 2), ' ') + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 2, 4), ' ')  + TextFormatting.NewLine + Concatenate(Slice(FtSplit, 4), ' ')
);&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Aug 2024 17:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-some-labels-won-t-show/m-p/1524564#M87206</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-20T17:44:26Z</dc:date>
    </item>
  </channel>
</rss>

