<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic What is causing my calculated expression to not work in Map Viewer/ExB when it works great in Field Maps? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/what-is-causing-my-calculated-expression-to-not/m-p/1683138#M67796</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Here is my Arcade:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had anyone else run into this and are there any workarounds?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Feb 2026 18:57:50 GMT</pubDate>
    <dc:creator>marksm_macomb</dc:creator>
    <dc:date>2026-02-09T18:57:50Z</dc:date>
    <item>
      <title>What is causing my calculated expression to not work in Map Viewer/ExB when it works great in Field Maps?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/what-is-causing-my-calculated-expression-to-not/m-p/1683138#M67796</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Here is my Arcade:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had anyone else run into this and are there any workarounds?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2026 18:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/what-is-causing-my-calculated-expression-to-not/m-p/1683138#M67796</guid>
      <dc:creator>marksm_macomb</dc:creator>
      <dc:date>2026-02-09T18:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: What is causing my calculated expression to not work in Map Viewer/ExB when it works great in Field Maps?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/what-is-causing-my-calculated-expression-to-not/m-p/1683701#M67833</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/670616"&gt;@marksm_macomb&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share a screenshot of the error message? Do you see any error messages in the console in dev tools?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2026 16:41:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/what-is-causing-my-calculated-expression-to-not/m-p/1683701#M67833</guid>
      <dc:creator>EmilyGeo</dc:creator>
      <dc:date>2026-02-11T16:41:51Z</dc:date>
    </item>
  </channel>
</rss>

