Hi @EmilyGeo , sorry to bother you again, but I've hit another wall and cannot wrap my head around the code that is required.
Similar scenario as before, but now I would like the line features created in a Cable layer to pull the Pole ID for the Start and End points of the lines (i.e., Cable A feature starts at Pole 1 feature and ends at Pole 2 feature, and thus the Start ID and End ID fields in the Cable layer would be auto populated with "Pole 1" and "Pole 2"). I found some references to "looping" thru the line to acquire this along with the start/end point functions for lines, but I'm struggling to understand.
I did use the below, which worked but only for extracting the Pole ID if the Pole point was snapped to a midpoint of the line, it wouldn't extract the ID of the pole where the line started/ended:
// Define a Featureset (poles) from the layer "Pole" in the $map
// that contains the attribute ['ID']
var poles = FeatureSetByName($map, "Pole", ['ID'])
// Define a variable (PoleID) to store the value we want
// Get the value by Intersecting the point location
// with the FeatureSet "Pole", or poles
var PoleID = First(EnvelopeIntersects($feature, poles))
// If the current location intersects Pole,
// return the value in the field ['ID'].
// Otherwise, return a null value for areas where there is no intersecting point
if (!IsEmpty(PoleID)) {
return PoleID['ID']
} else {
return "test"
}
I appreciate any help you could offer. Thank you!