<?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: Arcade Error for Indicator Code in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582808#M63551</link>
    <description>&lt;P&gt;This was for a dashboard indicator. Appreciate the response and I will look into this.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2025 19:13:11 GMT</pubDate>
    <dc:creator>JakeReichelt</dc:creator>
    <dc:date>2025-02-06T19:13:11Z</dc:date>
    <item>
      <title>Arcade Error for Indicator Code</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582737#M63540</link>
      <description>&lt;P&gt;I am trying to create an indicator that will display a number for both the number of critical infrastructures within an impacted area as well as the number of hospitals within an active evacuation zone. I am receiving an error message saying "&lt;SPAN&gt;Test execution error: Unknown Error. Verify test data." I am having a hard time deciphering what the issue with the code is.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here is the code for reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Layer source information
var p = portal('https://arcgis.com');
var crit_infra = FeatureSetByPortalItem(portal(p), 'fbb2f2bd73cb4ece92800d3527f9680d', 0, ['*']);
var impacted_area = FILTER(FeatureSetByPortalItem(portal(p), '996efbd08dc8478d9a9315a33ed50bda', 0, ['*']), "activeincid = 'Yes'");
var hcc_mem = FeatureSetByPortalItem(portal(p), '45e9dac6ea264c76818149c4b15717ea', 0, ['*']);
var evac_zone = FILTER(FeatureSetByPortalItem(portal(p), 'b84c5fc156f3420398e21b93c75c00b9', 0, ['*']), "activeincid = 'Yes'");

var final_count = 0;

//Get total count of critical infrastructure intersected by any active impacted areas
for(var i in impacted_area){
  var i_count = Count(Intersects(crit_infra, i))
  Console(i_count + ' critical infrastructure')

  final_count += i_count

  Console(final_count)
};

var hcc_count = 0;

//Get total count of hcc members intersected by any active evacuation zones
for (var j in evac_zone){
  var j_count = Count(Intersects(hcc_mem, j))
  Console(j_count + 'hcc members')

  hcc_count += j_count

  Console(hcc_count)
};

//Create data schema
var tabl = {
  'fields': [
    {'name': 'cntType', 
    'type': 'esriFieldTypeString'},
    {'name': 'cntImpCI', 
    'type': 'esriFieldTypeInteger'},
    {'name': 'cntTypes',
    'type': 'esriFieldTypeString'},
    {'name': 'cntHCC',
    'type': 'esriFieldTypeInteger'}],
  'geometryType': '',
  'features': [],
};

//add data to data schema
tabl.features[0] = {
  'attributes':{
    'cntType': 'Impacted Infrastructure',
    'cntImpCI': final_count,
    'cntTypes': 'HCC Members',
    'cntHCC': hcc_count,
  }
};

//return the featureset
return FeatureSet(Text(tabl));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 16:53:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582737#M63540</guid>
      <dc:creator>JakeReichelt</dc:creator>
      <dc:date>2025-02-06T16:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Error for Indicator Code</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582751#M63541</link>
      <description>&lt;P&gt;Not able to test at the moment, but perhaps it is in the portal(p) in the FeatureSetByPortalItem.&lt;/P&gt;&lt;P&gt;Documentation shows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var features = FeatureSetByPortalItem(Portal('https://www.arcgis.com'),'7b1fb95ab77f40bf8aa09c8b59045449',0,['Name', 'Count'],false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and you have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var p = portal('https://arcgis.com');
var crit_infra = FeatureSetByPortalItem(portal(p), 'fbb2f2bd73cb4ece92800d3527f9680d', 0, ['*']);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where you have already set the variable p = portal('&lt;A href="https://arcgis.com" target="_blank" rel="noopener"&gt;https://arcgis.com&lt;/A&gt;') then in the FeatureSetByPortalItem it is basically calling portal(portal('&lt;A href="https://arcgis.com" target="_blank" rel="noopener"&gt;https://arcgis.com&lt;/A&gt;')) (also, you might need the www in there as well&amp;nbsp;p = portal('https://&lt;STRONG&gt;www&lt;/STRONG&gt;.arcgis.com')&lt;/P&gt;&lt;P&gt;Perhaps something like this will work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var p = Portal('https://www.arcgis.com');
var crit_infra = FeatureSetByPortalItem(p, 'fbb2f2bd73cb4ece92800d3527f9680d', 0, ['*']);
var impacted_area = FILTER(FeatureSetByPortalItem(p, '996efbd08dc8478d9a9315a33ed50bda', 0, ['*']), "activeincid = 'Yes'");
var hcc_mem = FeatureSetByPortalItem(p, '45e9dac6ea264c76818149c4b15717ea', 0, ['*']);
var evac_zone = FILTER(FeatureSetByPortalItem(p, 'b84c5fc156f3420398e21b93c75c00b9', 0, ['*']), "activeincid = 'Yes'");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; just got a chance to test this with Indicator in a Dashboard and get the same error with your code, but not with my modifications, except, doesn't appear to need the &lt;STRONG&gt;www&lt;/STRONG&gt;. in the portal URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 17:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582751#M63541</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2025-02-06T17:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Error for Indicator Code</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582756#M63542</link>
      <description>&lt;P&gt;What &lt;A href="https://developers.arcgis.com/arcade/profiles/" target="_self"&gt;Profile&lt;/A&gt; are you running this Arcade code in? If this was for a map popup, you'd be better off using &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname" target="_self"&gt;FeatureSetByName&lt;/A&gt; with the &lt;FONT face="courier new,courier"&gt;$map&lt;/FONT&gt; global to reference the other layers.&lt;/P&gt;&lt;P&gt;For anything more complex, the &lt;A href="https://developers.arcgis.com/arcade/playground/" target="_self"&gt;Playground&lt;/A&gt; is the only way I know to test your expressions. Unfortunately the Playground can only access public data, so you'll either have to hunt down a set of public data that's close enough to your data, or create test data from scratch using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetdefinition---featureset-1" target="_self"&gt;FeatureSet&lt;/A&gt; function. For what it's worth, I get the same "&lt;SPAN&gt;Verify test data" error in the playground so there might be a chance everything's working&amp;nbsp;&lt;EM&gt;except&lt;/EM&gt; accessing the data from AGOL, replacing that with test feature sets will help you isolate that issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 17:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582756#M63542</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-02-06T17:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Error for Indicator Code</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582807#M63550</link>
      <description>&lt;P&gt;This seemed to work, thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 19:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582807#M63550</guid>
      <dc:creator>JakeReichelt</dc:creator>
      <dc:date>2025-02-06T19:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Error for Indicator Code</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582808#M63551</link>
      <description>&lt;P&gt;This was for a dashboard indicator. Appreciate the response and I will look into this.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 19:13:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-for-indicator-code/m-p/1582808#M63551</guid>
      <dc:creator>JakeReichelt</dc:creator>
      <dc:date>2025-02-06T19:13:11Z</dc:date>
    </item>
  </channel>
</rss>

