<?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 Re: Arcade expression to auto populate attributes and include the indoors floor picker on polygon selection in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-auto-populate-attributes-and/m-p/1642602#M11280</link>
    <description>&lt;P&gt;My team is struggling with the same issue right now. We have found this page of documentation for the Experience Builder Floor Filter Widget:&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/floor-filter-widget.htm#ESRI_SECTION1_6104325539AB43A0945A6382C5B04C70" target="_blank" rel="noopener"&gt;Floor Filter widget—ArcGIS Experience Builder | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you scroll down to near the bottom there is an Arcade script:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;if ($editcontext.editType == "INSERT") {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var levelsLayer = FeatureSetByName($map, "Levels", ["*"], true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var features = Intersects(levelsLayer,$feature);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;if (Count(features) &amp;gt; 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var levelId = First(features)["LEVEL_ID"]; return levelId; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;} return $feature["LEVEL_ID"];&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;We have had inconsistent luck with getting this to function correctly. It sometimes errors out with 'Failed to calculate value'. But worth a shot.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;For Field Maps the Arcade is a little different due to how Experience Builder and Field Maps natively support Indoors. We got a script from the Field Maps Team for Unit ID, which could potentially be modified to populate Level ID:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if(IsEmpty(Geometry($feature)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&lt;/P&gt;&lt;P&gt;else if (IsEmpty($feature.LEVEL_ID)){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var filt_floor = $feature.LEVEL_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result = First(Intersects($feature,Filter(FeatureSetByName($map, 'Units'),'LEVEL_ID = @filt_floor')));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(IsEmpty(result))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result.UNIT_ID;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Aug 2025 21:01:08 GMT</pubDate>
    <dc:creator>czahn2</dc:creator>
    <dc:date>2025-08-15T21:01:08Z</dc:date>
    <item>
      <title>Arcade expression to auto populate attributes and include the indoors floor picker on polygon selection</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-auto-populate-attributes-and/m-p/1642415#M11278</link>
      <description>&lt;P&gt;I have ArcIndoors and all my floor data (using the Indoors schema). I want to spin up web maps using smart forms, to where when a person places say a point in the Fire Extinguisher layer, it will auto populate in the extinguisher attributes for the LEVEL_ID, Building Number/Name, Room Number, grabbing said attributes from the Facilities/Levels/Units Indoor layers. This is the Arcade expression I used, but it seemingly isn't taking into account the floor picker. Any suggestions?&lt;/P&gt;&lt;P&gt;function getContainingID(Levels, LEVEL_ID) {&lt;BR /&gt;var fs = FeatureSetByName($map, Levels, [LEVEL_ID, "SHAPE@"]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var hit = First(&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Intersects(fs, Geometry($feature))&lt;BR /&gt;);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return IIF(&lt;BR /&gt;&amp;nbsp;&amp;nbsp; IsEmpty(hit),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; null,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; hit[LEVEL_ID]&lt;BR /&gt;);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 16:17:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-auto-populate-attributes-and/m-p/1642415#M11278</guid>
      <dc:creator>schulte_a</dc:creator>
      <dc:date>2025-08-15T16:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to auto populate attributes and include the indoors floor picker on polygon selection</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-auto-populate-attributes-and/m-p/1642602#M11280</link>
      <description>&lt;P&gt;My team is struggling with the same issue right now. We have found this page of documentation for the Experience Builder Floor Filter Widget:&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/floor-filter-widget.htm#ESRI_SECTION1_6104325539AB43A0945A6382C5B04C70" target="_blank" rel="noopener"&gt;Floor Filter widget—ArcGIS Experience Builder | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you scroll down to near the bottom there is an Arcade script:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;if ($editcontext.editType == "INSERT") {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var levelsLayer = FeatureSetByName($map, "Levels", ["*"], true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var features = Intersects(levelsLayer,$feature);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;if (Count(features) &amp;gt; 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;var levelId = First(features)["LEVEL_ID"]; return levelId; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;} return $feature["LEVEL_ID"];&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;We have had inconsistent luck with getting this to function correctly. It sometimes errors out with 'Failed to calculate value'. But worth a shot.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;For Field Maps the Arcade is a little different due to how Experience Builder and Field Maps natively support Indoors. We got a script from the Field Maps Team for Unit ID, which could potentially be modified to populate Level ID:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if(IsEmpty(Geometry($feature)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&lt;/P&gt;&lt;P&gt;else if (IsEmpty($feature.LEVEL_ID)){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var filt_floor = $feature.LEVEL_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result = First(Intersects($feature,Filter(FeatureSetByName($map, 'Units'),'LEVEL_ID = @filt_floor')));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(IsEmpty(result))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result.UNIT_ID;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 21:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-to-auto-populate-attributes-and/m-p/1642602#M11280</guid>
      <dc:creator>czahn2</dc:creator>
      <dc:date>2025-08-15T21:01:08Z</dc:date>
    </item>
  </channel>
</rss>

