Any help with this greatly appreciated.
I am trying to run a script using the Calculate Field tool (a script by @JohannesLindner ).
// load the polygons
var polygons = FeaturesetByName($datastore, Counties)
// get the polygon that intersects the current point
var i_polygon = First(Intersects(polygons, $feature))
// return a default value if no polygon is intersecting
if(i_polygon == null) { return null }
// return the name of the Polygon
return i_polygon.COUNTY
This has previously worked for me but when I try it with a different polygon layer (Counties) I get an error code: ERROR 002717: Invalid Arcade expression, Arcade error: Object not found counties, Script line: 2
The polygon layer is in a local folder and is definitely in the Contents.
Thanks.