Select to view content in your preferred language

What is causing my calculated expression to not work in Map Viewer/ExB when it works great in Field Maps?

240
1
02-09-2026 10:57 AM
Labels (1)
marksm_macomb
Frequent Contributor

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? 

0 Kudos
1 Reply
EmilyGeo
Esri Regular Contributor

Hi @marksm_macomb

Can you share a screenshot of the error message? Do you see any error messages in the console in dev tools? 

0 Kudos