<?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 ArcGIS Dashboard Data Expression &amp;quot;unable to execute Arcade script&amp;quot; in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409224#M9405</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm was asked to create an indicator in an ArcGIS Dashboard that relied on counts from multiple layers in the map. After some googling, I came up with the code below (redacted item IDs since this data is confidential).&lt;/P&gt;&lt;P&gt;When I run it in the expression builder, it gives me the output "number: 27" which is correct. However when I click done, I see a little error triangle with an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;!&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;telling me "Unable to execute Arcade script".&lt;/P&gt;&lt;P&gt;I tried to use the solution from this post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/td-p/1052347" target="_blank" rel="noopener"&gt;Solved: ArcGIS Dashboard Data Expression, "unable to execu... - Esri Community&lt;/A&gt;&amp;nbsp;but it didn't work or I didn't execute the solution correctly. Any ideas? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var features_riley = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "####"
);

var features_ottawa = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_dickson = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_washington = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_republic = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_saline = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_cloud = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_marshall = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_clay = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_geary = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var total = (Count(Filter(features_ottawa, "Status IS NOT NULL")) +
      Count(Filter(features_marshall, "Status IS NOT NULL")) +
      Count(Filter(features_riley, "Status IS NOT NULL")) +
      Count(Filter(features_dickson, "Status IS NOT NULL")) +
      Count(Filter(features_washington, "Status IS NOT NULL")) +
      Count(Filter(features_republic, "Status IS NOT NULL")) +
      Count(Filter(features_saline, "Status IS NOT NULL")) +
      Count(Filter(features_cloud, "Status IS NOT NULL")) +
      Count(Filter(features_clay, "Status IS NOT NULL"))) /
    (Count(features_ottawa) +
      Count(features_riley) +
      Count(features_dickson) +
      Count(features_washington) +
      Count(features_republic) +
      Count(features_saline) +
      Count(features_cloud) +
      Count(features_marshall) +
      Count(features_clay) +
      Count(features_geary)) *
  100;

var result = Round(total, 0);
return result&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>Fri, 12 Apr 2024 20:40:31 GMT</pubDate>
    <dc:creator>SarahW2799</dc:creator>
    <dc:date>2024-04-12T20:40:31Z</dc:date>
    <item>
      <title>ArcGIS Dashboard Data Expression "unable to execute Arcade script"</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409224#M9405</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm was asked to create an indicator in an ArcGIS Dashboard that relied on counts from multiple layers in the map. After some googling, I came up with the code below (redacted item IDs since this data is confidential).&lt;/P&gt;&lt;P&gt;When I run it in the expression builder, it gives me the output "number: 27" which is correct. However when I click done, I see a little error triangle with an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;!&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;telling me "Unable to execute Arcade script".&lt;/P&gt;&lt;P&gt;I tried to use the solution from this post:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/td-p/1052347" target="_blank" rel="noopener"&gt;Solved: ArcGIS Dashboard Data Expression, "unable to execu... - Esri Community&lt;/A&gt;&amp;nbsp;but it didn't work or I didn't execute the solution correctly. Any ideas? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var features_riley = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "####"
);

var features_ottawa = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_dickson = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_washington = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_republic = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_saline = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_cloud = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_marshall = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_clay = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var features_geary = FeatureSetByPortalItem(
  Portal("https://www.arcgis.com"),
  "###"
);

var total = (Count(Filter(features_ottawa, "Status IS NOT NULL")) +
      Count(Filter(features_marshall, "Status IS NOT NULL")) +
      Count(Filter(features_riley, "Status IS NOT NULL")) +
      Count(Filter(features_dickson, "Status IS NOT NULL")) +
      Count(Filter(features_washington, "Status IS NOT NULL")) +
      Count(Filter(features_republic, "Status IS NOT NULL")) +
      Count(Filter(features_saline, "Status IS NOT NULL")) +
      Count(Filter(features_cloud, "Status IS NOT NULL")) +
      Count(Filter(features_clay, "Status IS NOT NULL"))) /
    (Count(features_ottawa) +
      Count(features_riley) +
      Count(features_dickson) +
      Count(features_washington) +
      Count(features_republic) +
      Count(features_saline) +
      Count(features_cloud) +
      Count(features_marshall) +
      Count(features_clay) +
      Count(features_geary)) *
  100;

var result = Round(total, 0);
return result&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>Fri, 12 Apr 2024 20:40:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409224#M9405</guid>
      <dc:creator>SarahW2799</dc:creator>
      <dc:date>2024-04-12T20:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Dashboard Data Expression "unable to execute Arcade script"</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409228#M9406</link>
      <description>&lt;P&gt;A Data Expression has to return a FeatureSet&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//var result = Round(total, 0);
//return result
var Dict = {
    'fields': [
        {'name': 'Result', 'type': 'esriFieldTypeInteger'}],
    'geometryType': '',   
    'features': []};

// fill the data schema with the data
Dict.features[0] = {
            'attributes': {
                'Result': Round(total, 0)
            }}

// return the featureset
return FeatureSet(Text(Dict));&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 20:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409228#M9406</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-12T20:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Dashboard Data Expression "unable to execute Arcade script"</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409727#M9409</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 13:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1409727#M9409</guid>
      <dc:creator>SarahW2799</dc:creator>
      <dc:date>2024-04-15T13:44:29Z</dc:date>
    </item>
  </channel>
</rss>

