<?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: Intersect two feature layers in Experience Builder? in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707191#M23461</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might need to replace the last line with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return Count(Intersects(&lt;STRONG&gt;$feature&lt;/STRONG&gt;, sites));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what worked for me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-06-09 173652.png" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153636iAD77DA7D4ED034AB/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screenshot 2026-06-09 173652.png" alt="Screenshot 2026-06-09 173652.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2026 16:38:26 GMT</pubDate>
    <dc:creator>EMani</dc:creator>
    <dc:date>2026-06-09T16:38:26Z</dc:date>
    <item>
      <title>Intersect two feature layers in Experience Builder?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707171#M23458</link>
      <description>&lt;P&gt;I have an Arcade expression in AGOL Experience Builder where I'm trying to intersect two layers: a point layer named sites and a polygon layer named counties. I want to get the count of counties that have a site in them.&lt;/P&gt;&lt;P&gt;I retrieve each layer using&amp;nbsp;&lt;SPAN&gt;FeatureSetByPortalItem (since apparently ExB has no profile variables like $map) and include geometry. This works fine for both layers. But the code&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var result = Count(Intersects(counties, sites));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;gives the error "&lt;SPAN&gt;Test execution error: Execution error - Invalid parameter. Verify test data.". What is the problem here, and is there a way to fix or get around it? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2026 15:57:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707171#M23458</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2026-06-09T15:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two feature layers in Experience Builder?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707175#M23459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a similar case with Field Maps, where geometry needed to be set to false, so this might also work for you with Experience Builder...&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG&gt;If you ask Field Maps to load geometry (true), it often FAILS.&lt;/STRONG&gt;&lt;BR /&gt;This is a known Field Maps issue with&amp;nbsp;FeatureSetByPortalItem.&lt;BR /&gt;When geometry fails to load, Field Maps gives you an empty layer → Intersects finds nothing.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If you&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;don’t&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ask for geometry (false), Field Maps works.&lt;/STRONG&gt;&lt;BR /&gt;Field Maps&amp;nbsp;can fetch the geometry when needed.&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;includeGeometry = true&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;→ Field Maps breaks&lt;/LI&gt;&lt;LI&gt;includeGeometry = false&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;→ Field Maps handles geometry itself → works&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Why this happens:&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Map Viewer runs Arcade on Esri’s servers.&lt;BR /&gt;Because it runs on the server, it can automatically access full geometry from any layer, even if you set:&lt;/P&gt;&lt;PRE&gt;includeGeometry = false&lt;/PRE&gt;&lt;P&gt;Intersects belongs to a group of functions that can fetch geometry later, during the calculation.&amp;nbsp;Because of this, both Map Viewer and Field Maps can run:&lt;/P&gt;&lt;PRE&gt;Intersects($feature, FeatureSetByPortalItem(..., false))&lt;/PRE&gt;&lt;P&gt;without needing geometry upfront.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2026 16:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707175#M23459</guid>
      <dc:creator>EMani</dc:creator>
      <dc:date>2026-06-09T16:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two feature layers in Experience Builder?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707184#M23460</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/809575"&gt;@EMani&lt;/a&gt;&amp;nbsp;, but that didn't work in ExB. Same error. Full code in expression, if helpful:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Counties
var counties = FeatureSetByPortalItem(
    Portal('https://www.arcgis.com'), 
    '12345089c11a4913b0768381fa012345', 
    0,
    ['Name'], 
    false
);

// Resource sites
var sites = FeatureSetByPortalItem(
    Portal('https://www.arcgis.com'), 
    '12345e6579894e739285f626c7e12345', 
    1,
    ['Name'], 
    false
);

return Count(Intersects(counties, sites));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2026 16:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707184#M23460</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2026-06-09T16:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two feature layers in Experience Builder?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707191#M23461</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might need to replace the last line with:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return Count(Intersects(&lt;STRONG&gt;$feature&lt;/STRONG&gt;, sites));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what worked for me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-06-09 173652.png" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153636iAD77DA7D4ED034AB/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screenshot 2026-06-09 173652.png" alt="Screenshot 2026-06-09 173652.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2026 16:38:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707191#M23461</guid>
      <dc:creator>EMani</dc:creator>
      <dc:date>2026-06-09T16:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two feature layers in Experience Builder?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707232#M23462</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/809575"&gt;@EMani&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again. Unfortunately, the error popping up with that is that it doesn't recognize $feature. There are no profile variables in the ExB Arcade profile. &lt;A href="https://developers.arcgis.com/arcade/profiles/experience-builder-data/" target="_self"&gt;Documentation&lt;/A&gt; does say it includes the Geometry function bundle, which includes Intersects. It's a mystery!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2026 18:33:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/intersect-two-feature-layers-in-experience-builder/m-p/1707232#M23462</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2026-06-09T18:33:55Z</dc:date>
    </item>
  </channel>
</rss>

