<?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 Arcade: TextFormatting.NewLine in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1152731#M44822</link>
    <description>&lt;P&gt;Is there a way to create spacing in-between line breaks for an Arcade expression?&lt;/P&gt;&lt;P&gt;Below is a script&lt;/P&gt;&lt;P&gt;//field in the point address feature layer&lt;BR /&gt;var geoid = $feature.GEOID&lt;/P&gt;&lt;P&gt;//WV Fixed Dec2020 v1 is the related table&lt;BR /&gt;var fcc = FeatureSetById($map, /* WV Fixed Dec2020 v1 */ "17f74d21aeb-layer-4")&lt;/P&gt;&lt;P&gt;//filter function to match all addresses that share the same blockcode&lt;BR /&gt;var filterStatement = "BlockCode = @geoid"&lt;/P&gt;&lt;P&gt;//variable for related table&lt;BR /&gt;var providers = Filter(fcc, filterStatement)&lt;/P&gt;&lt;P&gt;//build out pop-up&amp;nbsp;&lt;BR /&gt;var popupResult = ''&lt;BR /&gt;for (var f in providers) {&lt;BR /&gt;popupResult += " - " + f.ISP + " (" + f.Technology + ") " + " (" + f.Service + ") " + TextFormatting.NewLine&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return popupResult&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final result currently looks like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (Asymmetric xDSL) (Residential | Commercial)&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (ADSL2, ADSL2+) (Residential | Commercial)&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (VDSL) (Residential | Commercial)&lt;BR /&gt;- ViaSat, Inc. | Viasat Inc | ViaSat, Inc. (Satellite) (Residential | Commercial)&lt;BR /&gt;- UNITED STATES CELLULAR CORPORATION | United States Cellular Corporation | Telephone and Data Systems, Inc. (Fixed Wireless) (Residential)&lt;BR /&gt;- GCI Communication Corp. | GCI Communication Corp. | GCI Holdings LLC (Satellite) (Commercial)&lt;BR /&gt;- HNS License Sub, LLC | HughesNet | Hughes Network Systems, LLC (Satellite) (Residential | Commercial)&lt;BR /&gt;- VSAT Systems, LLC. | VSAT Systems, LLC. | VSAT Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired outcome would look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (Asymmetric xDSL) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (ADSL2, ADSL2+) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (VDSL) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- ViaSat, Inc. | Viasat Inc | ViaSat, Inc. (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- UNITED STATES CELLULAR CORPORATION | United States Cellular Corporation | Telephone and Data Systems, Inc. (Fixed Wireless) (Residential)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- GCI Communication Corp. | GCI Communication Corp. | GCI Holdings LLC (Satellite) (Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- HNS License Sub, LLC | HughesNet | Hughes Network Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- VSAT Systems, LLC. | VSAT Systems, LLC. | VSAT Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 20:54:44 GMT</pubDate>
    <dc:creator>JamieHoffmann</dc:creator>
    <dc:date>2022-03-10T20:54:44Z</dc:date>
    <item>
      <title>Arcade: TextFormatting.NewLine</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1152731#M44822</link>
      <description>&lt;P&gt;Is there a way to create spacing in-between line breaks for an Arcade expression?&lt;/P&gt;&lt;P&gt;Below is a script&lt;/P&gt;&lt;P&gt;//field in the point address feature layer&lt;BR /&gt;var geoid = $feature.GEOID&lt;/P&gt;&lt;P&gt;//WV Fixed Dec2020 v1 is the related table&lt;BR /&gt;var fcc = FeatureSetById($map, /* WV Fixed Dec2020 v1 */ "17f74d21aeb-layer-4")&lt;/P&gt;&lt;P&gt;//filter function to match all addresses that share the same blockcode&lt;BR /&gt;var filterStatement = "BlockCode = @geoid"&lt;/P&gt;&lt;P&gt;//variable for related table&lt;BR /&gt;var providers = Filter(fcc, filterStatement)&lt;/P&gt;&lt;P&gt;//build out pop-up&amp;nbsp;&lt;BR /&gt;var popupResult = ''&lt;BR /&gt;for (var f in providers) {&lt;BR /&gt;popupResult += " - " + f.ISP + " (" + f.Technology + ") " + " (" + f.Service + ") " + TextFormatting.NewLine&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;return popupResult&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final result currently looks like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (Asymmetric xDSL) (Residential | Commercial)&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (ADSL2, ADSL2+) (Residential | Commercial)&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (VDSL) (Residential | Commercial)&lt;BR /&gt;- ViaSat, Inc. | Viasat Inc | ViaSat, Inc. (Satellite) (Residential | Commercial)&lt;BR /&gt;- UNITED STATES CELLULAR CORPORATION | United States Cellular Corporation | Telephone and Data Systems, Inc. (Fixed Wireless) (Residential)&lt;BR /&gt;- GCI Communication Corp. | GCI Communication Corp. | GCI Holdings LLC (Satellite) (Commercial)&lt;BR /&gt;- HNS License Sub, LLC | HughesNet | Hughes Network Systems, LLC (Satellite) (Residential | Commercial)&lt;BR /&gt;- VSAT Systems, LLC. | VSAT Systems, LLC. | VSAT Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired outcome would look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (Asymmetric xDSL) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (ADSL2, ADSL2+) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- Frontier Communications Corporation | Frontier Communications Corporation | Frontier Communications Corporation (VDSL) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- ViaSat, Inc. | Viasat Inc | ViaSat, Inc. (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- UNITED STATES CELLULAR CORPORATION | United States Cellular Corporation | Telephone and Data Systems, Inc. (Fixed Wireless) (Residential)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- GCI Communication Corp. | GCI Communication Corp. | GCI Holdings LLC (Satellite) (Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- HNS License Sub, LLC | HughesNet | Hughes Network Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;- VSAT Systems, LLC. | VSAT Systems, LLC. | VSAT Systems, LLC (Satellite) (Residential | Commercial)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 20:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1152731#M44822</guid>
      <dc:creator>JamieHoffmann</dc:creator>
      <dc:date>2022-03-10T20:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade: TextFormatting.NewLine</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1152812#M44827</link>
      <description>&lt;P&gt;First things first: don't forget about the "code sample" button on here.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1646965565864.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36112i43CE448DAF63F10C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1646965565864.png" alt="jcarlson_0-1646965565864.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Second, you can definitely add line breaks like that. You &lt;EM&gt;could &lt;/EM&gt;just take the current script and include two newlines at the end of your popupResult += ... line.&lt;/P&gt;&lt;P&gt;However, this method is a bit less than idea, because it creates space at the end of your popup that you don't need. I would suggest making use of the &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#concatenate" target="_blank"&gt;Concatenate&lt;/A&gt; function. Instead of building the popup string in your loop, just append to an array, and then generate the string from that.&lt;/P&gt;&lt;P&gt;Also, I like to suggest the use of &lt;EM&gt;template&lt;/EM&gt; literals whenever possible, because it's just easier to read than all those + and " characters.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//field in the point address feature layer
var geoid = $feature.GEOID

//WV Fixed Dec2020 v1 is the related table
var fcc = FeatureSetById($map, /* WV Fixed Dec2020 v1 */ "17f74d21aeb-layer-4")

//filter function to match all addresses that share the same blockcode
var filterStatement = "BlockCode = @geoid"

//variable for related table
var providers = Filter(fcc, filterStatement)

var out_arr = []

//build out pop-up 
for (var f in providers) {
    Push(
        out_arr,
        `- ${f.ISP} (${f.Technology}) (${f.Service})`
    )
}

// Return all items in array, separated by two lines each
return Concatenate(out_arr, '\n\n')&lt;/LI-CODE&gt;&lt;P&gt;And here's me testing it on a sample layer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1646966203623.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36113i93943922F4F89898/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1646966203623.png" alt="jcarlson_1-1646966203623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 02:36:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1152812#M44827</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-11T02:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade: TextFormatting.NewLine</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1153072#M44841</link>
      <description>&lt;P&gt;Well this was great insight. Thank you Josh!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 21:03:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-textformatting-newline/m-p/1153072#M44841</guid>
      <dc:creator>JamieHoffmann</dc:creator>
      <dc:date>2022-03-11T21:03:13Z</dc:date>
    </item>
  </channel>
</rss>

