<?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: Parse out data from JSON in list (tried using FromJSON but cannot get it to work) in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1326082#M8428</link>
    <description>&lt;P&gt;&lt;STRONG&gt;FromJSON &lt;/STRONG&gt;is meant to parse text, but it looks like the contents of the field is an array, so you'll need to loop through the array the pull out specific values.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var comments = $datapoint['Comments']
var comments_string = ''

if (Count(comments) &amp;gt; 0) {
  
  var comment_arr = fromJSON(comments)
  var output_arr = []

  for (var c in comment_arr){
    Push(output_arr, comment_arr[c]['comment'])
  }

  comments_string = Concatenate(output_arr, '\n')
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's me testing it with a sample two-comment array.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1694025378945.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80018i9DA7038A61A473A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1694025378945.png" alt="jcarlson_0-1694025378945.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 18:36:29 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2023-09-06T18:36:29Z</dc:date>
    <item>
      <title>Parse out data from JSON in list (tried using FromJSON but cannot get it to work)</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1325943#M8425</link>
      <description>&lt;P&gt;I have a data field that I would like to parse out specific text to display in a list. I found the FromJSON function but am having a hard time getting it to work correctly. Right now I have the list displaying only records that have comments and would like to keep it that way.&lt;/P&gt;&lt;P&gt;Current list format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dwold_1-1694012898924.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79978i07B315EFC94E9B5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dwold_1-1694012898924.png" alt="dwold_1-1694012898924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Ideally, I would like the bottom comment section to read (if only one comment display that):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Delays to Dispatch&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Comment: New Comment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Comment: New Comment #2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Current arcade:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dwold_2-1694012949520.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79979i37733E1B0CFF084C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dwold_2-1694012949520.png" alt="dwold_2-1694012949520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/601561"&gt;@ChipMorgan65&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 18:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1325943#M8425</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2023-09-06T18:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Parse out data from JSON in list (tried using FromJSON but cannot get it to work)</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1326082#M8428</link>
      <description>&lt;P&gt;&lt;STRONG&gt;FromJSON &lt;/STRONG&gt;is meant to parse text, but it looks like the contents of the field is an array, so you'll need to loop through the array the pull out specific values.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var comments = $datapoint['Comments']
var comments_string = ''

if (Count(comments) &amp;gt; 0) {
  
  var comment_arr = fromJSON(comments)
  var output_arr = []

  for (var c in comment_arr){
    Push(output_arr, comment_arr[c]['comment'])
  }

  comments_string = Concatenate(output_arr, '\n')
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's me testing it with a sample two-comment array.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1694025378945.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80018i9DA7038A61A473A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1694025378945.png" alt="jcarlson_0-1694025378945.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 18:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1326082#M8428</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-09-06T18:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Parse out data from JSON in list (tried using FromJSON but cannot get it to work)</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1326101#M8432</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;wonderful, worked great. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 19:46:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/parse-out-data-from-json-in-list-tried-using/m-p/1326101#M8432</guid>
      <dc:creator>dwold</dc:creator>
      <dc:date>2023-09-06T19:46:50Z</dc:date>
    </item>
  </channel>
</rss>

