Hello,
I have a polygon layer (my city's districts) and a point layer (new trees planted in my city). The tree points are crowd-sourced from a survey 123, it is therefore a shared update layer with sync enabled.
I want to display how many tree points are planted per district in a dashboard, perhaps in a list. For instance:
District A: 35 new trees
District B: 2 new trees
How can I connect the district polygon layer and the tree point layer in dashboard?
Here is what I have attempted so far:
In map viewer I have successfully done this using arcade in popup for the district polygon layer:
var treepoints= FeatureSetByName($map, "new_tree_points")
var numberoftrees= Count(Contains(treepoints,$feature))
return numberoftrees
This expression does not function in dashboard because I cannot figure out how to refer to another layer than the one I have selected. I have understood that the arcade profiles are different for map viewer and dashboard. In both dashboard List settings and Data expressions I have tried FeatureSetByPortalItem, but I get error message "Parse Error:featuresetbyportalitem is not available". My AGOL organization has not yet implemented Portal, is this the reason I cannot refer to a portal item?
I have also tried to calculate a field with this value and just show the new field in the dashboard list, but I have the same challenge with figuring out how to refer to another layer/feature. I also understand that Arcade cannot be used on hosted features with sync enabled so this may not be the way to go. Any pointers are appreciated.
Thanks in advance.