Hello all,
Hope all is well, so i need some Arcade help 🙂
So I finally got the code working to the point that code block says that "Expression is valid" but when I try to add a point to the map, I get the following error
Error:
Failed to create Pt.
Failed to evaluate Arcade expression. [
Rule name: Poly,
Triggering event: Insert,
Class name: Pt,
GlobalID: {4E52CA0C-099D-4593-80AF-292A5CFE51CF},
Arcade error: Indexable type expected,
Script line: 11]
Code:
// Read the polygon layer
var poly = FeatureSetByName($datastore, "poly");
// Intersect
var int = Intersects(poly, $feature);
// Check if there is an intersection
if (Count(int) > 0) {
// Get the first intersecting polygon's ABC value
var firstPoly = First(int);
return int.ABC;
} else {
// if there's no intersection then retain the original ABC value or return null
return $feature.ABC;
}
PS the map is being created in Pro 3.3.1 which will then published to AGOL and then that map will be used in Field Maps.
Solved! Go to Solution.
@jcarlson @KenBuja @XanderBakker can any of you you please help?
Line 10 should be
return firstPoly.ABC;
Good morning Ken, hope all is well 🙂
Yup that did it, thank you so much and have a great day!