<?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 expression Feature Set from Map in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284474#M7731</link>
    <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname" target="_blank" rel="noopener"&gt;Take a look here. Haven't used it myself, but worth a try.&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 19:27:16 GMT</pubDate>
    <dc:creator>ZenMasterZeke</dc:creator>
    <dc:date>2023-05-01T19:27:16Z</dc:date>
    <item>
      <title>Arcade expression Feature Set from Map</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284471#M7730</link>
      <description>&lt;P&gt;Hello, I have an Arcade expression put together for a Dashboard List, using FeatureSetByPortalItem to reference a Portal feature service.&amp;nbsp; The purpose is to create a list that sorts tracts by the latest date in any of three date type fields.&amp;nbsp; Because this is directly referencing the source feature service, and not the web map in the Dashboard, several Actions are unavailable, including 'Show Popup' and 'Zoom'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of using FeatureSetByPortalItem(&amp;lt;Portal&amp;gt;,&amp;lt;Portal Item ID&amp;gt;), is there a way to reference the layer from a web map, or otherwise define the popup so that can be displayed as an action?&lt;/P&gt;&lt;P&gt;Below is the Expression referencing the Portal feature service item and layer directly.&amp;nbsp; I just can't use this to zoom or display a pop-up.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal(&amp;lt;portal&amp;gt;); 

var fs = FeatureSetByPortalItem(portal,"&amp;lt;id&amp;gt;",&amp;lt;layer&amp;gt;,['*'],false); 

var date_dict = {
    fields: [{name: "MaxDate", type: "esriFieldTypeString"},{name: "Tract", type: "esriFieldTypeString"}],
    geometryType: "esriGeometryPolygon",
    features: [],
};

var acq_sql = "Appraisal IS NOT NULL and Survey IS NOT NULL and Opinion IS NOT NULL";

var acq_filter = Filter(fs, acq_sql);

for (var feature in acq_filter){
    var max_appr = Number(feature['Appraisal'])
    var max_surv = Number(feature['Survey'])
    var max_titl = Number(feature['Opinion'])
    var tract_num = (feature['tracts'])
    var max_date = Text(Max(max_appr, max_surv, max_titl));
    Push(date_dict.features, {"attributes": {"MaxDate": max_date,"Tract": tract_num},geometry: Geometry(feature)})
};

var newFeature = FeatureSet(Text(date_dict));
var orderFS = OrderBy(newFeature, 'MaxDate desc')
return orderFS&lt;/LI-CODE&gt;&lt;P&gt;A temporary workaround I have set is an action from this data expression list to filter another list using the same filter criteria but sorted by 'tracts'.&amp;nbsp; Users have to click twice, but that's not a huge deal - would be nice to be one click though.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284471#M7730</guid>
      <dc:creator>JustinWolff</dc:creator>
      <dc:date>2023-05-01T19:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression Feature Set from Map</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284474#M7731</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname" target="_blank" rel="noopener"&gt;Take a look here. Haven't used it myself, but worth a try.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284474#M7731</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2023-05-01T19:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression Feature Set from Map</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284492#M7733</link>
      <description>&lt;P&gt;Thanks GK.&amp;nbsp; I was trying this earlier, but $map isn't recognized, and I'm not sure how to define it as a variable, if it's possible.&amp;nbsp; I no longer have access to ArcGIS Assistant but would be curious to look at the .json of the Dashboard List element in ArcGIS Assistant Beta.&amp;nbsp; Maybe that would have a clue how a 'default' Dashboard element is referencing the $map.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 20:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1284492#M7733</guid>
      <dc:creator>JustinWolff</dc:creator>
      <dc:date>2023-05-01T20:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression Feature Set from Map</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1285816#M7751</link>
      <description>&lt;P&gt;Apparently the global variable $map isn't available in Dashboard. As far as I know (not that far&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;), the only action available to List elements is Filter.&lt;/P&gt;&lt;P&gt;I wonder if your list could filter another element that does have Zoom enabled, and the Zoom action could be automatically triggered by the list filtering action. I haven't seen Show Pop-up as an action anywhere, but never looked either.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 18:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-feature-set-from-map/m-p/1285816#M7751</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2023-05-04T18:46:01Z</dc:date>
    </item>
  </channel>
</rss>

