I am trying to customize the pop-up of a polygon layer in ArcGIS Pro with an arcade expression. I am working on a request to change inspection boundaries to transfer about 200 inspections from one district to another, so I want to create an expression that will show me how many inspection points intersect each district. I successfully used the following code in the Arcade Playground:
var parcels = FeatureSetByName($map, "Parcels_And_Buildings - Tax Parcels")
var parcelIntersect = Intersects($feature, parcels)
var parcelCount = Count(parcelIntersect)
return parcelCount
However, when I tried to add it as an expression for the pop-up of the inspection layer (with appropriate adaptations), I got the message "Invalid expression. Error on line 3. General function failure."
Going off of the message, it sounds like there is a problem with the count function. (I had originally nested the functions inside each other and then separated them to try to isolate the problem.) Has anybody else had a problem like this that they were able to solve? Could it be because there are roughly 600 points intersecting the polygon?
I also selected one of the districts and then tried doing a select by location on the points for the selected district. By comparing the results to what I got in ArcMap, I think it selected all the right points, but for some reason, the highlights are all over the place. It's really odd, because when I tell it to zoom to the selection, it zooms in to the selected district, but it doesn't show any of the points as being highlighted anymore.
Point highlights are scattered everywhere instead of being inside the selected district
I am on version 2.7, and I checked to make sure that I have the most current version. The points are being pulled from a SQL view. I am still adjusting to Pro. I've been trying to switch over, but if I can't get these issues straightened out, I guess I'll have to go back to ArcMap for this project.