<?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: Dashboard List Advanced Formatting null $datapoint values? in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199967#M6652</link>
    <description>&lt;P&gt;Thanks for the tip about the Mid function, I haven't seen that one before.&lt;/P&gt;&lt;P&gt;It might just be my lack of understanding of Arcade in general, but I can't get any attribute to return a non-null value in the expression. I know that the data exists -- I can display it in the Line item template just fine, but for whatever reason, everything returns a null value when I try to use it in an expression.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jamesw_0-1659721891256.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47933iC0CB2D1620E68DB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jamesw_0-1659721891256.png" alt="jamesw_0-1659721891256.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 17:52:12 GMT</pubDate>
    <dc:creator>jamesw</dc:creator>
    <dc:date>2022-08-05T17:52:12Z</dc:date>
    <item>
      <title>Dashboard List Advanced Formatting null $datapoint values?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199915#M6647</link>
      <description>&lt;P&gt;I have a map layer that I am using to create a list of features in an ArcGIS Online dashboard. The list is set up to display some basic data from each feature, but I want to use Arcade to add an extra line that shows when the feature was last updated.&lt;/P&gt;&lt;P&gt;The last update timestamp is stored as a string in each feature ('YYYYMMDDHHMMSS') in a field called "LastGPSUpdate". I've written an Arcade Expression that works when I manually plug in a string, but whenever I try to reference the actual data, it returns null values. In fact, all of the "$datapoint.XYZ" globals return null values.&lt;/P&gt;&lt;P&gt;Any assistance would be much appreciated!&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var dateInitial = $datapoint.LastGPSUpdate

var yearParse = Left(dateInitial, 4)
var monthParse = Right(Left(dateInitial, 6), 2)
var dayParse = Right(Left(dateInitial, 8), 2)

var dateParse = monthParse + '/' + dayParse + '/' + yearParse

Console(dateParse, $datapoint.BattalionArea,$datapoint.Beat,$datapoint.DispatchGroup,$datapoint.LastGPSUpdate,$datapoint.StationArea,$datapoint.Team,$datapoint.UnitType)

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  dateText: dateParse
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jamesw_0-1659716979370.png" style="width: 776px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47918i0B9FC7A9D6B8F505/image-dimensions/776x322?v=v2" width="776" height="322" role="button" title="jamesw_0-1659716979370.png" alt="jamesw_0-1659716979370.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="jamesw_1-1659716989937.png" style="width: 766px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47919i559B3F1EF35FFA6E/image-dimensions/766x316?v=v2" width="766" height="316" role="button" title="jamesw_1-1659716989937.png" alt="jamesw_1-1659716989937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 16:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199915#M6647</guid>
      <dc:creator>jamesw</dc:creator>
      <dc:date>2022-08-05T16:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard List Advanced Formatting null $datapoint values?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199962#M6651</link>
      <description>&lt;P&gt;I'm not sure what input value you're testing this with, but you could try to convert the string to a true &lt;STRONG&gt;date &lt;/STRONG&gt;value first, then use the &lt;STRONG&gt;Text &lt;/STRONG&gt;function to format it.&lt;/P&gt;&lt;P&gt;And also, you can use &lt;STRONG&gt;Mid&lt;/STRONG&gt; to get a set of characters from the middle of your text, rather than nesting right and left.&lt;/P&gt;&lt;P&gt;Additionally, you could check if the date string is null first, and return a default string.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var dateInitial = $datapoint.LastGPSUpdate

// stop expression early and return message if field is empty
if(IsEmpty(dateInitial)){
    return 'Date string is empty!'
} else {
    
    // convert to date
    var dateval = Date(
        Left(dateInitial, 4),
        Mid(dateInitial, 4, 2),
        Mid(dateInitial, 6, 2)
    )
    
    var dateParse = Text(dateval, 'MM/DD/YYYY')
    
    return dateParse
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 17:39:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199962#M6651</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-08-05T17:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard List Advanced Formatting null $datapoint values?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199967#M6652</link>
      <description>&lt;P&gt;Thanks for the tip about the Mid function, I haven't seen that one before.&lt;/P&gt;&lt;P&gt;It might just be my lack of understanding of Arcade in general, but I can't get any attribute to return a non-null value in the expression. I know that the data exists -- I can display it in the Line item template just fine, but for whatever reason, everything returns a null value when I try to use it in an expression.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jamesw_0-1659721891256.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47933iC0CB2D1620E68DB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jamesw_0-1659721891256.png" alt="jamesw_0-1659721891256.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 17:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1199967#M6652</guid>
      <dc:creator>jamesw</dc:creator>
      <dc:date>2022-08-05T17:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard List Advanced Formatting null $datapoint values?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1200791#M6658</link>
      <description>&lt;PRE&gt;return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  dateText: dateParse
}&lt;/PRE&gt;&lt;P&gt;Are you calling it as {expression/dateText}? In your response you are using {expression/dateParse} but that is not correct going by the return statement you had above. To make things simple, I always name the attributes the same name as my variable:&lt;/P&gt;&lt;P&gt;dateParse: dateParse&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 13:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1200791#M6658</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2022-08-09T13:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard List Advanced Formatting null $datapoint values?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1202997#M6678</link>
      <description>&lt;P&gt;Whoops, that was a typo in my example, thanks for catching that.&lt;/P&gt;&lt;P&gt;Unfortunately, changing to call it as {expression/dateParse} did not work. It is still returning null values in the console and no data is displayed in the list.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 18:46:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-list-advanced-formatting-null-datapoint/m-p/1202997#M6678</guid>
      <dc:creator>jamesw</dc:creator>
      <dc:date>2022-08-15T18:46:15Z</dc:date>
    </item>
  </channel>
</rss>

