I am trying to create an attribute rule that will allow me to create a point and take the attributes from a polygon and transfer them to the point when the point is created, if it's possible. in the attribute rules i get, Error002717: invalid arcade expression, Arcade error: Unexpected null
My attribute rule
// Read the polygon layer
var poly = FeatureSetByName($datastore, "polygons");
// Find intersecting polygon
var int = Intersects(poly, $feature);
// Check if there is an intersection
if (Count(int) > 0) {
// Get the first intersecting polygon's ParcelID value
var firstPoly = First(int);
return firstPoly.ParcelID;
} else {
// If there's no intersection, retain the existing ParcelID value
return firstPoly.ParcelID;
}