<?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: Data Expression in Dashboard returning errors after year of working in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646101#M11389</link>
    <description>&lt;P&gt;Attempting to find issues in the Arcade GUI can be infuriating. You are likely going to need to add console statements inside each of your loops, and after each function to help determine where the scripts is breaking.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Aug 2025 15:20:01 GMT</pubDate>
    <dc:creator>AustinAverill</dc:creator>
    <dc:date>2025-08-27T15:20:01Z</dc:date>
    <item>
      <title>Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646097#M11388</link>
      <description>&lt;P&gt;This data expression has been working for over a year and all the sudden stopped in the last week.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This data expression is to pull active checks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;Portal("&lt;A href="https://sjso-e911.maps.arcgis.com" target="_blank"&gt;https://sjso-e911.maps.arcgis.com&lt;/A&gt;"),&lt;BR /&gt;"13e8ddb852f94e7c840dbef6612ed728",&lt;BR /&gt;1,&lt;BR /&gt;[&lt;BR /&gt;"nbid2",&lt;BR /&gt;"nextrecheckdate",&lt;BR /&gt;"Name",&lt;BR /&gt;"birthday",&lt;BR /&gt;"schoolname1",&lt;BR /&gt;"yrddistrict1",&lt;BR /&gt;"activecase"&lt;BR /&gt;],&lt;BR /&gt;false&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;var date_exp = {&lt;BR /&gt;name: "Max_Date",&lt;BR /&gt;expression: "nextrecheckdate",&lt;BR /&gt;statistic: "MAX"&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;var grouped = GroupBy(fs, ["nbid2"], date_exp);&lt;BR /&gt;&lt;BR /&gt;var features = [];&lt;BR /&gt;var list = [];&lt;BR /&gt;&lt;BR /&gt;for (var f in grouped) {&lt;BR /&gt;var student = f["nbid2"];&lt;BR /&gt;var sdate = ToUTC(f["Max_Date"]);&lt;BR /&gt;var sdate_local = f["Max_Date"];&lt;BR /&gt;var sql = "nextrecheckdate = '" +&lt;BR /&gt;sdate +&lt;BR /&gt;"'AND nbid2 = '" +&lt;BR /&gt;student +&lt;BR /&gt;"'";&lt;BR /&gt;Push(features, sql);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;var joinedDict = {&lt;BR /&gt;fields: [&lt;BR /&gt;{ name: "nextrecheckdate", type: "esriFieldTypeDate"},&lt;BR /&gt;{ name: "nbid2", type: "esriFieldTypeString"},&lt;BR /&gt;{ name: "Name", type: "esriFieldTypeString"},&lt;BR /&gt;{ name: "birthday", type: "esriFieldTypeDate"},&lt;BR /&gt;{ name: "schoolname1", type: "esriFieldTypeString"},&lt;BR /&gt;{ name: "yrddistrict1", type: "esriFieldTypeString"},&lt;BR /&gt;{ name: "activecase", type: "esriFieldTypeString"}&lt;BR /&gt;],&lt;BR /&gt;geometryType: "",&lt;BR /&gt;features: []&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;//return features&lt;BR /&gt;for (var p in features) {&lt;BR /&gt;var n = features[p];&lt;BR /&gt;var fil = Filter(fs, n);&lt;BR /&gt;for (var h in fil) {&lt;BR /&gt;Push(&lt;BR /&gt;joinedDict["features"],&lt;BR /&gt;{&lt;BR /&gt;attributes:&lt;BR /&gt;{&lt;BR /&gt;nextrecheckdate: h["nextrecheckdate"],&lt;BR /&gt;nbid2: h["nbid2"],&lt;BR /&gt;Name: h["Name"],&lt;BR /&gt;birthday: h["birthday"],&lt;BR /&gt;schoolname1: h["schoolname1"],&lt;BR /&gt;yrddistrict1: h["yrddistrict1"],&lt;BR /&gt;activecase: h["activecase"],&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;return FeatureSet(Text(joinedDict))&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 15:14:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646097#M11388</guid>
      <dc:creator>VigilMelissaVigil</dc:creator>
      <dc:date>2025-08-27T15:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646101#M11389</link>
      <description>&lt;P&gt;Attempting to find issues in the Arcade GUI can be infuriating. You are likely going to need to add console statements inside each of your loops, and after each function to help determine where the scripts is breaking.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 15:20:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646101#M11389</guid>
      <dc:creator>AustinAverill</dc:creator>
      <dc:date>2025-08-27T15:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646110#M11390</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/609844"&gt;@VigilMelissaVigil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree with Austin on the console statements, you may also find some use in cutting down your program from the bottom up, start attempting to run/verify it's working with the variable assignments and Portal attach section. I think it could be your SQL statement improperly recognizing a keyword or something similar, I would try commenting that out or running a known working one and trying again!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 15:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646110#M11390</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-08-27T15:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646114#M11391</link>
      <description>&lt;P&gt;That error is usually associated with a problem in the Filter function sql statement. Check your fields and if those field names and values are valid.&lt;/P&gt;&lt;P&gt;You can make the sql statement easier to read using variable substitution (see the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;documentation&lt;/A&gt;). You don't have to worry about quotes using this syntax&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var student = f["nbid2"];
var sdate = ToUTC(f["Max_Date"]);
var sdate_local = f["Max_Date"];
var sql = "nextrecheckdate = @sdate AND nbid2 = @student";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 15:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646114#M11391</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-08-27T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646157#M11392</link>
      <description>&lt;P&gt;Yes agree with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp; i often see this issue with the filter function most likely some new or unexpected data has been added .&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;great tip on the&amp;nbsp;&lt;SPAN&gt;variable substitution&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 16:52:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646157#M11392</guid>
      <dc:creator>PaulSweeney3</dc:creator>
      <dc:date>2025-08-27T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression in Dashboard returning errors after year of working</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646190#M11393</link>
      <description>&lt;P&gt;That worked. Thank you so much. Sorry I am very new to Arcade.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 17:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-in-dashboard-returning-errors/m-p/1646190#M11393</guid>
      <dc:creator>VigilMelissaVigil</dc:creator>
      <dc:date>2025-08-27T17:39:09Z</dc:date>
    </item>
  </channel>
</rss>

