<?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 Needing to Return an Empty Feature Set in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420511#M9552</link>
    <description>&lt;P&gt;What is your expression actually returning? Can you share the code?&lt;/P&gt;&lt;P&gt;Returning an empty data expression is possible, and works just fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1715184529816.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103473i5F1D2515C1894B0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1715184529816.png" alt="jcarlson_0-1715184529816.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1715184537955.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103474i1FC47D2C2C3083A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1715184537955.png" alt="jcarlson_1-1715184537955.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 16:08:48 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2024-05-08T16:08:48Z</dc:date>
    <item>
      <title>Data Expression Needing to Return an Empty Feature Set</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420493#M9550</link>
      <description>&lt;P&gt;Is it normal behavior for a dashboard data expression to display "Unable to Execute Arcade Script" if it needs to return an empty feature set? When testing, the script executes as it should, it codes a dynamic indicator that at this point should display zero. Is there a workaround for this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 15:52:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420493#M9550</guid>
      <dc:creator>AlinaTarmu_SCGIS</dc:creator>
      <dc:date>2024-05-08T15:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression Needing to Return an Empty Feature Set</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420508#M9551</link>
      <description>&lt;P&gt;Can you post your script? Does it return an empty FeatureSet or the number 0?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 16:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420508#M9551</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-05-08T16:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression Needing to Return an Empty Feature Set</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420511#M9552</link>
      <description>&lt;P&gt;What is your expression actually returning? Can you share the code?&lt;/P&gt;&lt;P&gt;Returning an empty data expression is possible, and works just fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1715184529816.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103473i5F1D2515C1894B0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1715184529816.png" alt="jcarlson_0-1715184529816.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1715184537955.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103474i1FC47D2C2C3083A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1715184537955.png" alt="jcarlson_1-1715184537955.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 16:08:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1420511#M9552</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-05-08T16:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression Needing to Return an Empty Feature Set</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1423098#M9560</link>
      <description>&lt;P&gt;It returns an empty feature set. I created another script that returns an empty feature set and that one indeed works fine (thanks, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;!). It might be something in the script (or data, or most likely portal).&amp;nbsp; Here it is:&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;LI-CODE lang="javascript"&gt;// declaring portal variable
var portal = Portal("https://myportal.com/portal");
// filter work order feature set for required fields
var fs = Filter(
  FeatureSetByPortalItem(
    portal,
    '3f959g85g959595954ff9ggkdkgr',
    0,
    ["OBJECTID", "EQUIPMENT", "STATUS", "DATE_CREATED"],
    false,
    ),
  "STATUS LIKE 'Not Performed' AND PM_CODE LIKE 'SG-100SW-3'"
)

//generating an array of equipment values that have consecutive Not Performed cycles
var pairs = []
for (var r in fs) {
    var keys = r["EQUIPMENT"];
    var values = r["DATE_CREATED"];
    var keyvalue = {"key": keys, "value": values}
    Push(pairs, keyvalue)
}

var resultArray = [];
for (var i = 0; i &amp;lt; Count(pairs)-1; i++) {
  var current = pairs[i];
  var next = pairs[i + 1];

  if (Equals(current.key, next.key) &amp;amp;&amp;amp; Abs(DateDiff(Date(current.value),Date(next.value), "days")) &amp;lt;= 93) {
    Push(resultArray, current.key);
    }
}
//adding single quotes to the strings in the array so that the SQL filter recognizes them in order to match them to the equipment layer
var newFilter = [];
for (var i = 0; i&amp;lt; Count(resultArray)-1; i++) {
    var string = "'" + resultArray[i] + "'";
    newFilter[i] = string
    }

var eqFilter = `EQUIPMENT IN (${Concatenate(newFilter, ',')})`

//filtering the equipment layer for the equipment values in the array
return Filter(FeatureSetByPortalItem(
    portal,
    'otmbd4968695gmb09fkv99vkvv',
    0,
    ['*'],
    false,
    ),
eqFilter)&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;This script works perfectly for two other PM codes, with 31, respectively 62 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 16:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1423098#M9560</guid>
      <dc:creator>AlinaTarmu_SCGIS</dc:creator>
      <dc:date>2024-05-09T16:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expression Needing to Return an Empty Feature Set</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1467813#M9588</link>
      <description>&lt;P&gt;Today my other two data expressions, which were working perfectly, display the same error. SO IT IS DEFINITELY NOT THE CODE.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp; (This issue is related to the other issue I posted, with the chart built on a data expression not interacting with other dashboard elements, issue to which Josh answered.)&lt;/P&gt;&lt;P&gt;(Also: thank goodness for the Arcade Playground...)&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 20:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-needing-to-return-an-empty-feature/m-p/1467813#M9588</guid>
      <dc:creator>AlinaTarmu_SCGIS</dc:creator>
      <dc:date>2024-05-14T20:17:23Z</dc:date>
    </item>
  </channel>
</rss>

