Hello, I am trying to assign unique dates from a polygon layer to a point feature class based on an intersecting relationship. Here is some relevant info:
The polygon layer has about 600 different polygons.
The point feature class has about 3700 points. They do not all intersect the polygon layer.
The actual point feature class is restricted for editing (I cannot add fields, but I can manually calculate them).
I pulled some Arcade code from a similar post on here and ran it on different sized exports from the polygons and point FCs, and it worked perfectly. Now I am trying to use it on the real feature class points and its throwing the following error:
ERROR 002717: Invalid Arcade expression, Arcade error: Table not found polygons, Script line: 2
Here is the script I adapted:
// define the polygons that the information will be transferred from
var polygons = FeaturesetByName($datastore, "polygons")
// determine the polygon that intersects the current point
var i_polygon = First(Intersects(polygons, $feature))
// return an arbitrary default value if no polygon is intersecting - may need to retype date into expression
if(i_polygon == null) { return "1/1/1995" }
// return the name of the Polygon field with the information to be transferred
return i_polygon.FIELDNAME
I'm confused because I can manually calculate field for the real points, and I can use the real polygon layer to transfer attributes to exported points, but when I try a code block calculation on the real points no matter the polygon layer it always throws the same error. Help?