<?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 Arcade in dasboards in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139852#M5810</link>
    <description>&lt;P&gt;Thanks! yes I know this github repository. But it gives me an error . I don't know why I understand what the code is doing, I have gone through the functions, tested if it returns featuresets, but in the for part it gives me an error. I don't know how to debug arcade code&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 15:15:52 GMT</pubDate>
    <dc:creator>JiříKomínek</dc:creator>
    <dc:date>2022-02-02T15:15:52Z</dc:date>
    <item>
      <title>Arcgis Arcade in dasboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139716#M5807</link>
      <description>&lt;P&gt;Hi, I am trying to create a dashboard where I would spatially query two layers (point and polygon). I need to return the number of points lying in each polygon to a sheet. In Mapviewer this is not a problem using the arcade language, but I have spent many hours in the dashboard with no result. I am attaching the code that works in Mapviewer and I need to get it into Dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var osoby=FeatureSetByName($map,"Dopravní nehody / Traffic accidents")
var pocetOsob=Count(Intersects(osoby, $feature))
var intersectArea=Intersects(FeatureSetByName($map,"Traffic accidents"),$feature )

var list_pricin= groupBy(intersectArea, "id", {name:"count", expression: "id", statistic: "COUNT"})

var pocet= Count(list_pricin)

return pocet&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Feb 2022 06:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139716#M5807</guid>
      <dc:creator>JiříKomínek</dc:creator>
      <dc:date>2022-02-02T06:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Arcade in dasboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139795#M5808</link>
      <description>&lt;P&gt;In Dashboard Data Expressions, you need to return a &lt;STRONG&gt;FeatureSet&lt;/STRONG&gt; object for the Dashboard to work with the output.&lt;/P&gt;&lt;P&gt;The scenario you describe, counting points in a polygon, is exactly what is demonstrated in this example expression here: &lt;A href="https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SpatialAggregation.md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/dashboard_data/SpatialAggregation.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Simply replace the layer / field names with your own, and it should work.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 13:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139795#M5808</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-02T13:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Arcade in dasboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139852#M5810</link>
      <description>&lt;P&gt;Thanks! yes I know this github repository. But it gives me an error . I don't know why I understand what the code is doing, I have gone through the functions, tested if it returns featuresets, but in the for part it gives me an error. I don't know how to debug arcade code&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 15:15:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139852#M5810</guid>
      <dc:creator>JiříKomínek</dc:creator>
      <dc:date>2022-02-02T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Arcade in dasboards</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139859#M5811</link>
      <description>&lt;P&gt;Debugging Arcade is easier in a web environment where you can use the &lt;STRONG&gt;Console&lt;/STRONG&gt; function to return intermediate outputs. If your expression is going to work, it's going to have to look a lot like the linked expression from my initial reply. If we amend that expression and add some console functions, we may get a clearer idea of what's working and what isn't. For instance, you could alter the first part of your expression to return the count of features.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Portal
var portal = Portal('https://www.arcgis.com/');

// Create FeatureSet for polygons
var poly_fs = FeatureSetByPortalItem(
    portal,
    '312cebfea2624e108e234220b04460b8',
    0,
    [
        'ZONE'
    ],
    true
);

// See if polygons were returned
Console(`${Count(poly_fs)} features in poly_fs.`)

// Create Featureset for points
var pt_fs = FeatureSetByPortalItem(
    portal,
    '848d61af726f40d890219042253bedd7',
    0,
    [
        'capacity_mw'
    ],
    true
);

// See if points were returned
Console(`${Count(pt_fs)} features in pt_fs.`)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 15:22:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-arcade-in-dasboards/m-p/1139859#M5811</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-02T15:22:19Z</dc:date>
    </item>
  </channel>
</rss>

