Hi.
How can I show number of tree points per neighborhood in Dashboard?
I have these two layers:
- Point layer for tree points, an editable layer that is crowdsourced through Survey123, with sync enabled
- Polygon layer for neighborhoods (18 in total), this is a static layer
Here's what I've tried so far:
- Calculate field for the neighborhood layer using Arcade, count and intersect function. This gives the right result, but is not so great because the tree point layer is constantly updated and I believe I have to update this manually every time a new tree point is added to the point layer (?)
- Setting up a Data expression in a List in the dashboard, but I cannot get this to work. This is the expression I have tried:
var trees = FeatureSetByPortalItem( Portal('https://www.arcgis.com'), '3f225e2cadf14c9f644j72sf0d862fc3', 0, ['Name', 'Count'], false )
var neighborhood = FeatureSetByPortalItem( Portal('https://www.arcgis.com'), '00de4f987654332159ee8326d8bb9150b', 0, ['Name', 'Count'], false )
var countTrees = Count(Intersects(trees,neighborhood))
return countTrees - Including name of neighborhood already when the tree points are added using javascript to set up pulldata in Survey123 Connect, but this seems like a tall mountain to climb.
I am grateful for any tips or pointers.