Hi,
We hav a workflow where we use QC to collect data points when inspecting streetlighting. After when they have made the monthly inspection. They do a satus change in field maps when they are fixing the found issues.
To help to transfer over data from streetlighting and snapping QC point to closest pole. We have an attribute rule that calculates and snaps attributes and geometry from another layer in same referenced service in enterprise. It works in Arcgis Pro, Mapviver and webbaps and collector for Windows.
But the layer won't load in Fela maps and not show in mapwiev in Quick capture.
Says in Fieald maps gets this error ARCGIS_RUNTIME
Kod:
7018
Beskrivning:
Arcade expression is invalid.
Arcade expression:
function closest_feature(felkoder_stolpe, Stolpe) {
// returns the feature of compare_feature_set that is closest to test_feature
var min_distance = 9999999
var closest_feature = null
for(var f in stolpe) {
var d = Distance(felkoder_stolpe, f)
if(d < min_distance) {
min_distance = d
closest_feature = f
}
}
return closest_feature
}
// load the other featureset
var fs = FeatureSetByName($datastore, "Stolpe")
// get the feature that is closest to the current $feature
fs = Intersects(fs, Buffer($feature, 100)) // only analyze close-ish features
var f = closest_feature($feature, fs)
// abort if we didn't find something
if(f == null) { return }
// return the intersecting feature's value and snap the point to the found feature
return {
result: {
geometry: NearestCoordinate(f, $feature).coordinate,
attributes: {name: f.Name ,overordnad: f.__verordnad, anlaggningsnamn: f.anlaggningsnamn}
}
}
Can i do this in an other way? Or is Field maps incompatible. I can still collect data points in Quic Capture and int works.