<?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 Dynamic count of points inside a polygon in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1584478#M10744</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We have the following scenario where there are points coming from survey123 and it is falling inside a polygon.&lt;/P&gt;&lt;P&gt;We wish to know if it's dynamically possible to reflect the count of points inside a polygon in any dashboard element (indicator, etc.). On researching this, we found that by using arcade expression, it is possible to reflect it in the pop-up. Following is the arcade expression that we have set up in the polygon layer&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var points = FeatureSetByName($map, 'Point_layer')
var countp = Count(Intersects(points,$feature))
return countp&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We also found this link to the idea : &lt;A href="https://community.esri.com/t5/arcgis-dashboards-ideas/using-custom-attribute-expressions-from-pop-ups-as/idi-p/1565798" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-ideas/using-custom-attribute-expressions-from-pop-ups-as/idi-p/1565798&lt;/A&gt;&amp;nbsp;, so this makes us think that it is currently not possible. However, data expression has been suggested however, we are not sure what should be the expression.&lt;/P&gt;&lt;P&gt;Any inputs would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2025 15:53:34 GMT</pubDate>
    <dc:creator>wizgis</dc:creator>
    <dc:date>2025-02-12T15:53:34Z</dc:date>
    <item>
      <title>Dynamic count of points inside a polygon</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1584478#M10744</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We have the following scenario where there are points coming from survey123 and it is falling inside a polygon.&lt;/P&gt;&lt;P&gt;We wish to know if it's dynamically possible to reflect the count of points inside a polygon in any dashboard element (indicator, etc.). On researching this, we found that by using arcade expression, it is possible to reflect it in the pop-up. Following is the arcade expression that we have set up in the polygon layer&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var points = FeatureSetByName($map, 'Point_layer')
var countp = Count(Intersects(points,$feature))
return countp&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We also found this link to the idea : &lt;A href="https://community.esri.com/t5/arcgis-dashboards-ideas/using-custom-attribute-expressions-from-pop-ups-as/idi-p/1565798" target="_blank"&gt;https://community.esri.com/t5/arcgis-dashboards-ideas/using-custom-attribute-expressions-from-pop-ups-as/idi-p/1565798&lt;/A&gt;&amp;nbsp;, so this makes us think that it is currently not possible. However, data expression has been suggested however, we are not sure what should be the expression.&lt;/P&gt;&lt;P&gt;Any inputs would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 15:53:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1584478#M10744</guid>
      <dc:creator>wizgis</dc:creator>
      <dc:date>2025-02-12T15:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic count of points inside a polygon</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1584506#M10745</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/475615"&gt;@wizgis&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;It is possible to do so in Dashboards. You would simply create a new feature set under "Data Expressions" and use the newly created data for any of the needed widgets in the dashboard.&lt;/P&gt;&lt;P&gt;The code below should give you some ideas on how to go about it.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var P = Portal('&amp;lt;portal url&amp;gt;')
var Pnts = FeatureSetByPortalItem( P , '&amp;lt;item id&amp;gt;' , '&amp;lt;layer id&amp;gt;' , '&amp;lt;list of field names&amp;gt;' , True )// layer id is often 0 if the only layer
var Poly = FeatureSetByPortalItem( P , '&amp;lt;item id&amp;gt;' , '&amp;lt;layer id&amp;gt;' , '&amp;lt;list of field names&amp;gt;' , True )// layer id is often 0 if the only layer

var IntPntPoly = Intersects( Geoemtry( Pnts ) , Poly )
var GrpBy = GroupBy(IntPntPoly , '&amp;lt;layer name&amp;gt;', { name: '&amp;lt;custom field name&amp;gt;', expression: '&amp;lt;field name in layer&amp;gt;', statistic: 'COUNT' })
return GrpBy&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 17:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1584506#M10745</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-02-12T17:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic count of points inside a polygon</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1585493#M10755</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/22623"&gt;@RPGIS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for sharing your inputs however, had to modify the expression as Geometry function doesn't take feature set as input. Used the following link for reference:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/arcade-data-expression-intersects-for-dashboard/td-p/1265441" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-questions/arcade-data-expression-intersects-for-dashboard/td-p/1265441&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 14 Feb 2025 15:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dynamic-count-of-points-inside-a-polygon/m-p/1585493#M10755</guid>
      <dc:creator>wizgis</dc:creator>
      <dc:date>2025-02-14T15:14:07Z</dc:date>
    </item>
  </channel>
</rss>

