<?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: 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/1055710#M4491</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried figuring this out by browsing through GeoNet but can't find anything relating to this issue...I added the console function right before the return statement at the end, because this is still returning an empty dictionary. When I hit "Test" and view the output from the console, I see this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;["features returned",{"fields":[{"name":"EQNum","type":"esriFieldTypeString"},{"name":"InspecDate","type":"esriFieldTypeDate"},{"name":"PtStatus","type":"esriFieldTypeString"}],"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-7997522.018099999,"y":5207172.07,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2013-026","InspecDate":"2020-07-29T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7997970.5297,"y":5214400.591300003,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ1989-015","InspecDate":"2020-09-30T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7993994.632999999,"y":5212258.8379999995,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2020-052","InspecDate":"2020-10-19T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-8002495.5656,"y":5219019.943500005,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2017-040","InspecDate":"2020-11-23T17:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7998590.2183,"y":5226627.4831000045,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2021-020","InspecDate":"2021-04-21T16:00:00.000Z","PtStatus":"Unstable"}}]}]&lt;/LI-CODE&gt;&lt;P&gt;The console returns the 5 results I am looking for/know should be returned. I was unsure if this was happening because of the included geometry, so I removed that and tested again with the same result (console showing 5 features, but empty dictionary.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 16:05:12 GMT</pubDate>
    <dc:creator>erica_poisson</dc:creator>
    <dc:date>2021-05-07T16:05:12Z</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/1052347#M4433</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very new to Arcade (which you probably be able to tell by my filter expressions below).&lt;/P&gt;&lt;P&gt;I am attempting to create a Data Expression that can be used to power an Indicator widget in a Dashboard. I have built and tested this in the Data Expression builder within my Dashboard and when I click "test" it returns the proper result. I click done, but then see a little triangle with an &lt;STRONG&gt;!&lt;/STRONG&gt; telling me "Unable to execute Arcade script".&lt;/P&gt;&lt;P&gt;Why would I see this message? My Arcade script is below. Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;

var fs1 = FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false);

var filterCMpts = Filter(fs1, "Point_Status ='Unstable' AND EQ_File_Number ='EQ2015-078' OR Point_Status ='Unstable' AND  EQ_File_Number = 'Eq2013-026' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2018-082' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2018-052' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2001-080X' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2003-021' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ1989-015' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2002-023' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2002-045X' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2019-110' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2020-017' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2019-091' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2018-029' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2020-033' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2019-036' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2020-052' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2019-064' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2017-040' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2020-031' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2021-003' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2011-016' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2017-026' OR Point_Status ='Unstable' AND  EQ_File_Number = 'EQ2021-020'");

var itemID_join = 'xxx';
var layerID_join = 0;

var fs2 = FeatureSetByPortalItem(Portal(p), itemID_join, layerID_join, ['Point_Status_revisit', 'EQ_File_Number'], false);

var filterJoin = Filter(fs2, "Point_Status_revisit ='Stable' AND EQ_File_Number ='EQ2015-078' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'Eq2013-026' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2018-082' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2018-052' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2001-080X' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2003-021' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ1989-015' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2002-023' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2002-045X' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2019-110' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2020-017' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2019-091' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2018-029' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2020-033' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2019-036' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2020-052' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2019-064' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2017-040' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2020-031' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2021-003' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2011-016' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2017-026' OR Point_Status_revisit ='Stable' AND  EQ_File_Number = 'EQ2021-020'");

var CntCMpts = Count(filterCMpts)
var CntJoin = Count(filterJoin)

return CntCMpts - CntJoin&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 16:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1052347#M4433</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-04-28T16:14:04Z</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/1052485#M4435</link>
      <description>&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/dashboards/get-started/create-data-expressions.htm" target="_self"&gt;Data expressions&lt;/A&gt; generate a FeatureSet, so that's all you can return, not the count of your two FeatureSets.&lt;/P&gt;&lt;P&gt;A note about your SQL statement.&amp;nbsp; You can make it much shorter using this format&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', etc)" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 20:52:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1052485#M4435</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-04-28T20:52:15Z</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/1053982#M4452</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&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;You actually can return an in-memory featureset with the data that you want to graph. Since I am not sure what you are exactly after I will provide an example and you can adjust accordingly.&lt;/P&gt;&lt;P&gt;See the example below (please note that the filter expression is using the syntax suggested by Ken). The first part is pretty much the same, but after getting the counts, you create a schema for the output featureset, and fill it with the data. In this case, it will be a featureset with 3 fields and only 1 row. This can be used in the Dashboard as data source.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var itemID_join = 'xxx';
var layerID_join = 0;

var fs1 = FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false);
var filterCMpts = Filter(fs1, "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', etc)" );

var fs2 = FeatureSetByPortalItem(Portal(p), itemID_join, layerID_join, ['Point_Status_revisit', 'EQ_File_Number'], false);
var filterJoin = Filter(fs2, "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', etc)");

var CntCMpts = Count(filterCMpts);
var CntJoin = Count(filterJoin);

// create data schema
var Dict = {
    'fields': [
        {'name': 'CntCMpts', 'type': 'esriFieldTypeInteger'},
        {'name': 'CntJoin', 'type': 'esriFieldTypeInteger'},
        {'name': 'CntCMptsMinusCntJoin', 'type': 'esriFieldTypeInteger'}],
    'geometryType': '',   
    'features': []};

// fill the data schema with the data
Dict.features[0] = {
            'attributes': {
                'CntCMpts': CntCMpts,
                'CntJoin': CntJoin,
                'CntCMptsMinusCntJoin': CntCMpts - CntJoin
            }}

// return the featureset
return FeatureSet(Text(Dict));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1053982#M4452</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-03T20:54:36Z</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/1053985#M4453</link>
      <description>&lt;P&gt;Below an example of the featureset that will be returned using some random values for the counts:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_0-1620075312396.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12447i2CD464FDAE302E75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_0-1620075312396.png" alt="XanderBakker_0-1620075312396.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:56:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1053985#M4453</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-03T20:56:06Z</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/1054259#M4454</link>
      <description>&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;Thank you for the example. I was able to get this to work using something I came up with that basically does what you showed in the example. Unfortunately, this is not quite what I need after reflecting on the results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I really want to be able to do is get the count of records in my point layer that &lt;U&gt;do not&lt;/U&gt; have any related records associated with them. Is that possible using the FeatureSetByRelationshipName parameter? I've seen some other posts you have responded to around FeatureSetByRelationshipName, but none of the examples talk about doing something like what I am trying to accomplish.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054259#M4454</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-04T16:02:01Z</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/1054291#M4455</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I just had a look in the list of functions available when creating an Arcade data expression. For instance, the Attachments function is not available, but&amp;nbsp;&lt;SPAN&gt;FeatureSetByRelationshipName is. I assume you published your data and related data with a relationship class. If this is not the case, you can still use the filter function to get the same result. The performance will depend greatly on the number of features you have since a loop through all features is required to get this result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Based on the sample expression you shared, have a look at the expression below:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "the name of the relationship between data and related data";

var fs1 = FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false);

var tot = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['DummyField'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        tot += 1;
    }
}

return tot;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this example for each feature the related features are queried and if the count is 0, the total is incremented by one. At the end you should have the number of features that have no related records.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054291#M4455</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-04T16:58:52Z</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/1054358#M4456</link>
      <description>&lt;P&gt;I will give this a try tomorrow morning. One question...the relationship name that I put in there, is it the name of the relationship class in the fGDB from pre-publishing to AGOL?&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 18:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054358#M4456</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-04T18:45:02Z</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/1054392#M4457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Good question... Normally, when you edit an Arcade expression you will have access to the properties and the easiest way is navigating the interface to use the relationship. Let me visualize this.&lt;/P&gt;&lt;P&gt;In the expression editor you would find the $feature on the right and you can enter and find all the fields of this $feature (click on "&amp;gt;" in blue rectangle):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_0-1620157139052.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12531iE24096CB6899016D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_0-1620157139052.png" alt="XanderBakker_0-1620157139052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Next, at the end of the list of attributes you would find "Related records" and you can see all the relationships (click on "&amp;gt;" in blue rectangle)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_1-1620157274001.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12532i906B9AD3EC8C6D28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_1-1620157274001.png" alt="XanderBakker_1-1620157274001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This will show the relationship and when you click on the "FeatureSetByRelationshipName" link it will be correctly inserted in the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, since you access the data in the data expression using the "FeatureSetByPortalItem" you will not find those options in the interface.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can go to the details page of the hosted feature layer and open the REST end point:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_2-1620157438189.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12533iF6547D43A6BCAC2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_2-1620157438189.png" alt="XanderBakker_2-1620157438189.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the REST endpoint page at the end, you will find the relationships section with the name of the relationship:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_3-1620157499282.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12534i5A27716F31B10863/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_3-1620157499282.png" alt="XanderBakker_3-1620157499282.png" /&gt;&lt;/span&gt;&lt;/P&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>Tue, 04 May 2021 19:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054392#M4457</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-04T19:46:20Z</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/1054605#M4462</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ah I see. I am perplexed by my data. This was created via Pro with a named relationship class based on GlobalID/GUID, however this is what I see via the REST endpoint. I would have expected to see the relationship class name that I defined in Pro before I published these data to ArcGIS Online.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_tefft_0-1620219376479.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12567iB8B315BFDC3CFC8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_tefft_0-1620219376479.png" alt="erica_tefft_0-1620219376479.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Out of curiosity, I added this layer to a new map and went into the pop-up to add a new expression. I clicked through $feature like you mentioned, found related records at the bottom and then clicked FeatureSetByRelationshipName to add it into the builder window. This is what I see.&amp;nbsp;&lt;/P&gt;&lt;P&gt;FeatureSetByRelationshipName($feature,"")&lt;/P&gt;&lt;P&gt;Here is the Arcade I attempted...I am now getting the "Unable to execute Arcade script" message again, even though it returns the correct number of records when I click "Test":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";

var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");

var tot = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        tot += 1;
    }
}

return tot;&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;&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, 05 May 2021 13:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054605#M4462</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-05T13:56:04Z</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/1054633#M4463</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;That is interesting. It returns the correct value, but it does show an error. Maybe the name for the relationshipclass that should be used has to be "Construction_Monitoring_Revisit" (I am not sure). The best way to validate this is to add the layer to the map and use the navigation in the interface when creating an expression as described earlier. Just to be sure that you are using the correct name.&lt;/P&gt;&lt;P&gt;I am also wondering if it is enough to return the count as a number or that a featureset is expected. I think the latter. In that case, you could use something like the expression below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "Construction_Monitoring_Revisit";

var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");

var tot = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        tot += 1;
    }
}

// return tot;

// create data schema
var Dict = {
    'fields': [
        {'name': 'CountNoAttach', 'type': 'esriFieldTypeInteger'}],
    'geometryType': '',   
    'features': []};

// fill the data schema with the data
Dict.features[0] = {
            'attributes': {
                'CountNoAttach': tot
            }}

// return the featureset
return FeatureSet(Text(Dict));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 14:21:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054633#M4463</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-05T14:21:49Z</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/1054646#M4464</link>
      <description>&lt;P&gt;That worked perfectly! Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question I do have...what are your recommended methods for someone to learn more about Arcade? I have taken the courses available through the Esri training catalog, but felt they left a lot to be desired. I do look at the Developer Reference for Arcade, but I find this less helpful in some instances.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 14:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054646#M4464</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-05T14:37:53Z</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/1054660#M4465</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One additional question has come up. In my Dashboard, I have a map. I would like to set a Map Action so that all of my indicators are updated based on map extent. When I set this, my indicator changes to display "no data". Are map actions not compatible with elements configured via Data Expression?&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 14:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054660#M4465</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-05T14:53:11Z</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/1054670#M4466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;That is a good question. I have seen some limitations with actions configured between widgets in the dashboard (not maps) when using data expressions. It seems that if two widgets use a different data expression, they cannot be linked (even if the resulting featureset have a common key). I can understand the logic behind this, but it is kinda limiting when it shouldn't.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think map actions will work because your featureset based on an Arcade data expression will not have the same schema as the data in the map (or perhaps does not have geometries to be filtered by extent). Use layer actions, it might work since you can specify the input and output fields that should match. However, it is most likely that it will not work as you are experiencing.&lt;/P&gt;&lt;P&gt;If the action should be related to those records that do not have attachments, the creation of the data expression featureset should include the individual geometries in order to filter those using the extent. This would be more work but might be possible (not sure though).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 15:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054670#M4466</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-05T15:13:29Z</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/1054695#M4467</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The Esri Training catalog and learn paths are good ways to start. The developer help can be useful to understand each function (although sometimes it might be a bit confusing). Paul Barker has written some very good blogs on Arcade, Hussein Nasser more on Arcade in Attribute Rules and&amp;nbsp;David Nyenhuis on Arcade in Dashboards:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/?s=#arcade" target="_blank"&gt;https://www.esri.com/arcgis-blog/?s=#arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic knowledge of JavaScript might be an advantage, although Arcade is just a subset of JavaScript with some specific functions added.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have published some blogs/documents here in the Esri Community, but some of them are Spanish:&amp;nbsp;&lt;A href="https://community.esri.com/t5/forums/searchpage/tab/message?filter=authorId,includeTkbs&amp;amp;q=arcade&amp;amp;include_tkbs=true&amp;amp;author_id=1108&amp;amp;collapse_discussion=true" target="_blank"&gt;https://community.esri.com/t5/forums/searchpage/tab/message?filter=authorId,includeTkbs&amp;amp;q=arcade&amp;amp;include_tkbs=true&amp;amp;author_id=1108&amp;amp;collapse_discussion=true&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you did by reaching out to the Esri Community is a very good way of getting help when starting with Arcade or resolving complex challenges further along the road. There are many users that are willing to help others and that makes this community so great.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 15:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054695#M4467</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-05T15:25:50Z</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/1054710#M4469</link>
      <description>&lt;P&gt;Thank you for this information - that all makes sense and is what I suspected. I will play around with this and see if I can figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate all of your help and your learning suggestions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 15:32:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1054710#M4469</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-05T15:32:29Z</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/1055656#M4489</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for another question. I am trying to create a new data expression to populate a list with some basic information on these features that have no related records. I also want to pass through the geometry so I can then use the list to zoom to features in the map; this time I am maintaining the unique ID field "EQ File Number" which I hope will allow me to accommodate this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below is kind of a Frankenstein from the code you helped me with the other day and some other code I used in a different data expression. It creates the dictionary, but when I "Test" it just shows an empty table. I had figured I wanted to do all of this within the first for loop, but I am not really sure. If you had a suggestion, it would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";

var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number', 'Inspection_Date'], true), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");

var i = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        i +=1;
        // create data schema
        var Dict = {
            'fields': [
                {'name': 'EQNum', 'type': 'esriFieldTypeString'},
                {'name': 'InspecDate', 'type': 'esriFieldTypeDate'},
                {'name': 'PtStatus', 'type': 'esriFieldTypeString'},
            ],
              'geometryType': '',
              'features':[]};
        for (var f in fs1) {
            attributes: {
                EQNum: f["EQ_File_Number"],
                InspecDate: f["Inspection_Date"],
                PtStatus: f["Point_Status"],
            },
        };
        i++
    }
    }
return FeatureSet(Text(Dict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 14:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1055656#M4489</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-07T14:00:14Z</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/1055669#M4490</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The structure is a bit different. The schema is created once before the loop and you need to insert the results in the feature. When you need to include the geometry this is something you also need to include in the dictionary. I have not worked with returning geometries in data expression, but if I consult the syntax of the json it should be something like this:&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;// settings
var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";

// access first featureset
var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number', 'Inspection_Date'], true), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");

// create data schema
var Dict = {
    'fields': [
        {'name': 'EQNum', 'type': 'esriFieldTypeString'},
        {'name': 'InspecDate', 'type': 'esriFieldTypeDate'},
        {'name': 'PtStatus', 'type': 'esriFieldTypeString'}],
'geometryType': 'esriGeometryPoint',
'features':[]};

// analysis and fill Dict
var i = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        Dict.features[i] = {
            'geometry': Geometry(f),
            'attributes': {
                'EQNum': f["EQ_File_Number"],
                'InspecDate': f["Inspection_Date"],
                'PtStatus': f["Point_Status"]
            }
        };
        i++;
    }
}

return FeatureSet(Text(Dict));&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, 07 May 2021 14:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1055669#M4490</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-07T14:48:05Z</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/1055710#M4491</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried figuring this out by browsing through GeoNet but can't find anything relating to this issue...I added the console function right before the return statement at the end, because this is still returning an empty dictionary. When I hit "Test" and view the output from the console, I see this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;["features returned",{"fields":[{"name":"EQNum","type":"esriFieldTypeString"},{"name":"InspecDate","type":"esriFieldTypeDate"},{"name":"PtStatus","type":"esriFieldTypeString"}],"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-7997522.018099999,"y":5207172.07,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2013-026","InspecDate":"2020-07-29T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7997970.5297,"y":5214400.591300003,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ1989-015","InspecDate":"2020-09-30T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7993994.632999999,"y":5212258.8379999995,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2020-052","InspecDate":"2020-10-19T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-8002495.5656,"y":5219019.943500005,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2017-040","InspecDate":"2020-11-23T17:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7998590.2183,"y":5226627.4831000045,"spatialReference":{"latestWkid":3857,"wkid":102100}},"attributes":{"EQNum":"EQ2021-020","InspecDate":"2021-04-21T16:00:00.000Z","PtStatus":"Unstable"}}]}]&lt;/LI-CODE&gt;&lt;P&gt;The console returns the 5 results I am looking for/know should be returned. I was unsure if this was happening because of the included geometry, so I removed that and tested again with the same result (console showing 5 features, but empty dictionary.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 16:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1055710#M4491</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-07T16:05:12Z</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/1055722#M4492</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/356939"&gt;@erica_poisson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;In the returned json I notice that the geometry also contains the spatial reference for each feature. I am not sure if this may be causing any conflict.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;			"spatialReference": {
				"latestWkid": 3857,
				"wkid": 102100
			}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We can change the expression and exclude that part and see what happens. I must admit that in the past I have had situations where a correctly formed JSON is created and an empty feature set is returned. Not sure if we are running into a restriction here.&lt;/P&gt;&lt;P&gt;One thing we can try is this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// settings
var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";

// access first featureset
var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number', 'Inspection_Date'], true), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");

// create data schema
var Dict = {
    'fields': [
        {'name': 'EQNum', 'type': 'esriFieldTypeString'},
        {'name': 'InspecDate', 'type': 'esriFieldTypeDate'},
        {'name': 'PtStatus', 'type': 'esriFieldTypeString'}],
'geometryType': 'esriGeometryPoint',
'features':[]};

// analysis and fill Dict
var i = 0;
for (var f in fs1) {
    var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
    var cnt = Count(fs2);
    if (cnt == 0) {
        Dict.features[i] = {
            'geometry': {
                'x': Geometry(f)["X"],
                'y': Geometry(f)["Y"]
            }, 
            'attributes': {
                'EQNum': f["EQ_File_Number"],
                'InspecDate': f["Inspection_Date"],
                'PtStatus': f["Point_Status"]
            }
        };
        i++;
    }
}

Console(Text(Dict));

return FeatureSet(Text(Dict));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please share back what is returned in the console.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 16:29:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1055722#M4492</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-05-07T16:29:35Z</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/1055738#M4494</link>
      <description>&lt;P&gt;So with this example, I see (what looks like) the same result in the console, minus spatial reference info:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Use Console Function to output messages.

{"fields":[{"name":"EQNum","type":"esriFieldTypeString"},{"name":"InspecDate","type":"esriFieldTypeDate"},{"name":"PtStatus","type":"esriFieldTypeString"}],"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-7997522.018099999,"y":5207172.07},"attributes":{"EQNum":"EQ2013-026","InspecDate":"2020-07-29T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7997970.5297,"y":5214400.591300003},"attributes":{"EQNum":"EQ1989-015","InspecDate":"2020-09-30T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7993994.632999999,"y":5212258.8379999995},"attributes":{"EQNum":"EQ2020-052","InspecDate":"2020-10-19T16:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-8002495.5656,"y":5219019.943500005},"attributes":{"EQNum":"EQ2017-040","InspecDate":"2020-11-23T17:00:00.000Z","PtStatus":"Unstable"}},{"geometry":{"x":-7998590.2183,"y":5226627.4831000045},"attributes":{"EQNum":"EQ2021-020","InspecDate":"2021-04-21T16:00:00.000Z","PtStatus":"Unstable"}}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 16:51:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboard-data-expression-quot-unable-to/m-p/1055738#M4494</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2021-05-07T16:51:12Z</dc:date>
    </item>
  </channel>
</rss>

