I have a set of polygons (municipal boundaries) and a point layer. I'd like to (eventually) create a WebApp to show the number of points inside each municipality, but that point layer is going to be constantly updated (most likely each week).

I know a one time fix is a spatial join with number of intersection points as an attribute, but I was wondering if there was any method to query this sort of function to change as the point layer changes.

I want the symbology to update even if I add filters to the map. I could Python script it but that would only be for each write, where I want it to be truly dynamic.

Processes are planned to be done in ArcGIS Pro, but final product will be in ArcGIS Online

  • 1
    You tag this question as ArcPro then ask how to do something in a WebApp, suggest you edit your title/tag. You could look into Arcade and and using the intersects to drive labelling of your data?
    – Hornbydd
    Jan 10 at 17:52
  • If you are looking to do a dynamic spatial join within ArcGIS Pro, you could script your spatial join process and schedule the geoprocessing task to run at a time that works for you. pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/… Jan 10 at 18:19
  • @Hornbydd Sorry, I'm still flexible on doing the query entirely within ArcPro then just sharing the map itself, or doing the Querying online within AGOL. So although I did contradict myself, either of them would work. I think looking a bit more into Arcade might be a solution. The other answer seems to suggest something similar, so I'll take a look there. Thanks!
    – Barnard87
    Jan 13 at 17:54
  • @Tigerwoulds This might be the solution. As I'll be running timed scripts to import and generate the point data weekly, I could also do that for the spatial join process as well. I doubt it, but if the spatial join could be run due to a sort of trigger (like a filter being applied) that would be ideal, but probably not possible. Thanks for the help!
    – Barnard87
    Jan 13 at 17:55

1 Answer 1


Visualising the point count in a Polygon dynamically in ArcGIS Online is not possible. According to the ArcGIS Arcade: Visualisation page, the Arcade expressions only allow access to the $feature and $view.scale attributes - in other words you cannot access the " Geometry Intersection" between the polygon and points using this methodology.

ArcGIS Arcade Documentation

That being said, you can use Arcade to access this interaction using a custom pop-up using this Arcade Expression:

var points = FeatureSetByName($map, 'Point_layer')
var countp = Count(Intersects(points,$feature))
return countp

So you will most likely need to pre-process this intersection in the publising of the polygon layer. Are you responsible / the owner of the polygon layer? You could set up a script using arcpy to run a "Summarise" or Intersect and Spatial Join before the layer is published. Then re-publish / update the feature layer when you need it updated.

  • I think this is the direction I need to head. I'm the owner of all the data, which makes it easy. I already have a script to gather the point data weekly, so as another user mentioned, I could script the spatial join process to happen along with that. I appreciate that Arcade code snippet, I'll see what I can do with that, thanks for the help!
    – Barnard87
    Jan 13 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.