Hi All,
We have the following scenario where there are points coming from survey123 and it is falling inside a polygon.
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
var points = FeatureSetByName($map, 'Point_layer')
var countp = Count(Intersects(points,$feature))
return countp
We also found this link to the idea : https://community.esri.com/t5/arcgis-dashboards-ideas/using-custom-attribute-expressions-from-pop-up... , 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.
Any inputs would be helpful.
Solved! Go to Solution.
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:
Hi @wizgis,
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.
The code below should give you some ideas on how to go about it.
var P = Portal('<portal url>')
var Pnts = FeatureSetByPortalItem( P , '<item id>' , '<layer id>' , '<list of field names>' , True )// layer id is often 0 if the only layer
var Poly = FeatureSetByPortalItem( P , '<item id>' , '<layer id>' , '<list of field names>' , True )// layer id is often 0 if the only layer
var IntPntPoly = Intersects( Geoemtry( Pnts ) , Poly )
var GrpBy = GroupBy(IntPntPoly , '<layer name>', { name: '<custom field name>', expression: '<field name in layer>', statistic: 'COUNT' })
return GrpBy
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: