I have a field map that involves multiple relationships between different point/polygon features and one inspection table. I'm using calculated expressions in my smart form for the inspection table to pull ID's and locations from the parent feature. When I try to add an inspection record in Field Maps, the calculated expressions work as expected, but when I try to add an inspection record in Map Viewer or with the edit widget in an ExB, an error pops up saying it cannot be calculated.
Here is my Arcade:
var InletParent_id = $feature.InletParentGUID
var ManholeParent_id = $feature.ManholeParentGUID
var DischargeParent_id = $feature.DischargeParentGUID
var StructureParent_id = $feature.NetworkStructParentGUID
var related_Inlets = FeatureSetByName($map, "Stormwater Inlet - MS4",['GlobalID', 'FACILITYID'], false)
var related_Manholes = FeatureSetByName($map, "Stormwater Manhole - MS4",['GlobalID', 'FACILITYID'], false)
var related_Discharge = FeatureSetByName($map, "Stormwater Discharge Point - MS4",['GlobalID', 'FACILITYID'], false)
var related_Structure = FeatureSetByName($map, "Stormwater Network Structure - MS4",['GlobalID', 'FACILITYID'], false)
Var parent_Inlet = First(Filter(related_Inlets, 'GlobalID = @InletParent_id'))
Var parent_Manhole = First(Filter(related_Manholes, 'GlobalID = @ManholeParent_id'))
Var parent_Discharge = First(Filter(related_Discharge, 'GlobalID = @DischargeParent_id'))
Var parent_Structure = First(Filter(related_Structure, 'GlobalID = @StructureParent_id'))
if(parent_Inlet == null){
if(parent_Manhole == null){
if(parent_Discharge == null){
if(parent_Structure == null) {
return "N/A"
}
else {
return parent_Structure.FACILITYID
}
}
else {
return parent_Discharge.FACILITYID
}
}
else {
return parent_Manhole.FACILITYID
}
}
else {
return parent_Inlet.FACILITYID
}
Had anyone else run into this and are there any workarounds?
Hi @marksm_macomb,
Can you share a screenshot of the error message? Do you see any error messages in the console in dev tools?