<?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: Field contains multiple values separated by comma, want to list each on own line in popup. in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413708#M58758</link>
    <description>&lt;P&gt;Easy to do with Arcade. Instead of showing your Hazards field in the popup, you would should an Arcade expression instead:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theList = Split("dog,chair,pony,table,sunshine,rainbow",',');
var theOutput;

for(var index in theList) {
  theOutput = theOutput + theList[index] + '\n';
};
return Trim(theOutput);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code sample, you would change out my comma delineated text string with a reference to whatever field in your data that has that list (e.g. $feature.Hazards).&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 19:31:09 GMT</pubDate>
    <dc:creator>SteveCole</dc:creator>
    <dc:date>2024-04-22T19:31:09Z</dc:date>
    <item>
      <title>Field contains multiple values separated by comma, want to list each on own line in popup.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413700#M58756</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Survey123 form that has a question that allows multiple answers. When the survey is submitted the field (Hazards) where the answers are input shows each value, separated by a comma (see screenshot below). For example some of the possible answers are Roof_Open, Holes_in_floor, Hazardous_Material.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like the popup to display each of the answers on a new line so instead of being a list separated by commas, as shown above, it would appears as:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Hazards: Roof_Open&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Holes_in_floor&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AriLukas_0-1713812056229.png" style="width: 788px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101723i5DA277C64828DBB9/image-dimensions/788x63?v=v2" width="788" height="63" role="button" title="AriLukas_0-1713812056229.png" alt="AriLukas_0-1713812056229.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried creating an Array and then concatenating with the TexFormatting.NewLine but have not had any luck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 19:16:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413700#M58756</guid>
      <dc:creator>AriLukas</dc:creator>
      <dc:date>2024-04-22T19:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Field contains multiple values separated by comma, want to list each on own line in popup.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413708#M58758</link>
      <description>&lt;P&gt;Easy to do with Arcade. Instead of showing your Hazards field in the popup, you would should an Arcade expression instead:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theList = Split("dog,chair,pony,table,sunshine,rainbow",',');
var theOutput;

for(var index in theList) {
  theOutput = theOutput + theList[index] + '\n';
};
return Trim(theOutput);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code sample, you would change out my comma delineated text string with a reference to whatever field in your data that has that list (e.g. $feature.Hazards).&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 19:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413708#M58758</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2024-04-22T19:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Field contains multiple values separated by comma, want to list each on own line in popup.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413814#M58765</link>
      <description>&lt;P&gt;Building on &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/146007"&gt;@SteveCole&lt;/a&gt; , once you have an array of items, use the function &lt;STRONG&gt;Concatenate&lt;/STRONG&gt; to turn the array into a single string. This avoids having an extra line break at the end.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return Concatenate(
  Split($feature['hazards'], ','),
  '\n'
)&lt;/LI-CODE&gt;&lt;P&gt;Then again, if your items are broken up by commas, you could just use &lt;STRONG&gt;Replace&lt;/STRONG&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return Replace($feature['hazards'], ',', '\n')&lt;/LI-CODE&gt;&lt;P&gt;You could also use Replace to swap the underscores for spaces.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var spaced = Replace($feature['hazards'], '_', ' ')

return Replace(spaced, ',', '\n')&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Apr 2024 22:33:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1413814#M58765</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-04-22T22:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field contains multiple values separated by comma, want to list each on own line in popup.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1414652#M58806</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/146007"&gt;@SteveCole&lt;/a&gt;&amp;nbsp; for both of your replies. I had to slightly tweak the above code but I got it to work. I probably should have mentioned I am working in Classic viewer, the below code is what I got to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var spacedHazards = Replace($feature.hazards, '_', ' ')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;return Replace(spacedHazards, ',', '\n')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thank you both again!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 12:29:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/field-contains-multiple-values-separated-by-comma/m-p/1414652#M58806</guid>
      <dc:creator>AriLukas</dc:creator>
      <dc:date>2024-04-24T12:29:09Z</dc:date>
    </item>
  </channel>
</rss>

