I'm probably in the wrong group but I found something similar to my problem here:
Update Attribute of Intersecting from Point of Var... - Esri Community
I need to calculate the rough depth of a manhole. I can do this by pulling the upstream elevation of an attached pipe and subtracting it from the rim elevation of the manhole.
I have this example that pulls data from a point feature to a line feature and it works for me:
var g = Geometry($feature);
var fromPointGeometry = g.paths[0][0];
var fsPoint =FeatureSetByName($datastore, "ssInlet", ["FACILITYID"], false);
var fromPoint = First(Intersects(fsPoint, fromPointGeometry ) )
if (fromPoint == null) return
return fromPoint.FACILITYID;
So I tried this just to pull in a value which I can later subtract from the rim elevation.
var g = Geometry($feature);
var fromPointGeometry = g.paths[0][0];
var fsPoint =FeatureSetByName($datastore, "ssGravityMain", ["UPELEV"], false);
var fromPoint = First(Intersects(fsPoint, fromPointGeometry ) )
if (fromPoint == null) return
return fromPoint.UPELEV;
but it throws an error:
Error 2717 Invalid Arcade expression, arcade error: Field not found script line 2
I'm not very familiar with Arcade, could someone point out what I need to make this work?