<?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 expression to place attributes on separate lines from one field in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1018675#M38108</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset whereby several attributes have been entered into one single field and would like to put each on a new line so that the attribute window is much clearer.&amp;nbsp; Each entry is separated by a semicolon &lt;STRONG&gt;;&lt;/STRONG&gt;&amp;nbsp; Currently this looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CMcDonald_0-1611240914087.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4238i5B8805E2819A6F13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CMcDonald_0-1611240914087.png" alt="CMcDonald_0-1611240914087.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it possible to separate into:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Amenity Accommodation - 14&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Flat - 65&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Four in a Block - 60&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;House - 66&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Sheltered Accommodation - 38&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There are also other Housing types available in different polygons.&amp;nbsp; I wondered if some sort of IF = statement would be required to create the expression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;p.s. if Arcade is a suitable solution i am a novice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 15:04:22 GMT</pubDate>
    <dc:creator>CMcDonald</dc:creator>
    <dc:date>2021-01-21T15:04:22Z</dc:date>
    <item>
      <title>Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1018675#M38108</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset whereby several attributes have been entered into one single field and would like to put each on a new line so that the attribute window is much clearer.&amp;nbsp; Each entry is separated by a semicolon &lt;STRONG&gt;;&lt;/STRONG&gt;&amp;nbsp; Currently this looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CMcDonald_0-1611240914087.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4238i5B8805E2819A6F13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CMcDonald_0-1611240914087.png" alt="CMcDonald_0-1611240914087.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it possible to separate into:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Amenity Accommodation - 14&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Flat - 65&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Four in a Block - 60&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;House - 66&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Sheltered Accommodation - 38&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There are also other Housing types available in different polygons.&amp;nbsp; I wondered if some sort of IF = statement would be required to create the expression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;p.s. if Arcade is a suitable solution i am a novice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 15:04:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1018675#M38108</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2021-01-21T15:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1018732#M38113</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3871"&gt;@CMcDonald&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This can be done with Arcade. Have a look at the example below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// var test1 = $feature["Name of your Field goes here"];
var test1 = "Amenity Accommodation - 14; Flat - 65; Four in a Block - 60; House - 66; Sheltered Accommodation - 38";
var test2 = Replace(test1, "; ", ";");
var list = Split(test2, ";");
var result = Concatenate(list, TextFormatting.NewLine);
return result;&lt;/LI-CODE&gt;&lt;P&gt;The first line is commented ("//"), but explains how you could connect to the field that contains the list. The second line is just to create a variable with the list that you used in your example.&lt;/P&gt;&lt;P&gt;On the third line I first replace all the "; " (including the space) for just the ";" to avoid having redundant spaces and the start of each element.&lt;/P&gt;&lt;P&gt;On line 4 I use Split to split the text into a list of 5 elements&lt;/P&gt;&lt;P&gt;On line 5 the Concatenate function helps to create a text and we combine the elements with a new line. Ths will result in a multililine text:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_0-1611248219931.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4251i718275DFCCC8AC49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_0-1611248219931.png" alt="XanderBakker_0-1611248219931.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 16:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1018732#M38113</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-21T16:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019064#M38131</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I'm a total novice with Arcade I'm struggling understanding the code.&amp;nbsp; The field name would be&amp;nbsp;PROPBREAKDOWN so my first line of code looks like below, I'm assuming I shouldn't have this commented out i.e. //&lt;/P&gt;&lt;P&gt;var test1 = $feature.PROPBREAKDOWN&lt;BR /&gt;var test1 =&lt;/P&gt;&lt;P&gt;I'm then not sure about line 2, should i just copy &amp;amp; paste green text.&amp;nbsp; How does this work if other polygons in the dataset have different values against them i.e. if Amenity Accommodation had a value of 20 or 50 etc.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 11:23:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019064#M38131</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2021-01-22T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019078#M38132</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3871"&gt;@CMcDonald&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code would look like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var test1 = $feature.PROPBREAKDOWN;
var test2 = Replace(test1, "; ", ";");
var list = Split(test2, ";");
var result = Concatenate(list, TextFormatting.NewLine);
return result;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value in the text that follows Amenty Accommodation does not affect the expressión It is just part of the text. The initial text is separated by the semicolon. It does not matter much what comes before or after the semicolon. Let me know if it works or if you need any further explanation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 13:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019078#M38132</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-22T13:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019564#M38151</link>
      <description>&lt;P&gt;Excellent!, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 10:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019564#M38151</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2021-01-25T10:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to place attributes on separate lines from one field</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019682#M38162</link>
      <description>&lt;P&gt;You're Welcome&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3871"&gt;@CMcDonald&lt;/a&gt;&amp;nbsp;. I am glad it works.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-place-attributes-on-separate/m-p/1019682#M38162</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-01-25T16:41:31Z</dc:date>
    </item>
  </channel>
</rss>

