<?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 - in popup get points intersecting polygon when clicking on another point feature in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546510#M61853</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;I'm not sure who marked this as solved, but this doesn't seem to be working - that line fails to return anything and gives the same 'invalid parameter'. At first i thought it was because there are two 'First' functions, one that handles an array, and another that takes features and returns a feature, but since there is no way to specify which function I'm assuming Arcade figures out what the input and desired result is. Regardless, if you have other thoughts I'd appreciate it.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2024 13:36:56 GMT</pubDate>
    <dc:creator>clt_cabq</dc:creator>
    <dc:date>2024-10-08T13:36:56Z</dc:date>
    <item>
      <title>Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546297#M61842</link>
      <description>&lt;P&gt;I have a layer of points (call it points of interest), I would like to click on one, and obtain in a popup all the addresses (from address points) that fall within the parcel that the original point is within. I thought the approach below would work, but the the line 8 below fails, telling me there is an invalid parameter. There will be other steps after this that actually return the list of addresses for use in the popup, but can't implement that until i actually have a set to work with. This seems straightforward in my head (click on poi, get a parcel, get the address points that fall inside the parcel) but I'm obviously missing something. Thoughts?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// gets addresses that belong to a single parcel
var fs_parcels = FeatureSetByName($map, "parcel layer"['UPC','OWNER','OWNADD','SITUSADD'])
var targ_parcel = Intersects(fs_parcels, $feature) //target parcel from clicking on point of interest
console("returns " + Count(targ_parcel)+ " parcels")//gives me a count of 1, as expected
var fs_addr_pts = FeatureSetByName($map, "addr_points",['GeoAddress'])//creates feature set of address points in map
console("returns " + Count(fs_addr_pts))//returns 207,000 records found in featureset
//the next setp fails and doesn't return any features
var parcel_addrs = Intersects(fs_addr_pts, targ_parcel)
Console("returns " + count(parcel_addrs) + " addresses")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 19:46:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546297#M61842</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2024-10-07T19:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546305#M61843</link>
      <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#intersects" target="_self"&gt;Intersects&lt;/A&gt; function takes a FeatureSet and a Feature. Even though targ_parcel contains only one Feature, it's still considered a FeatureSet. What you have to do is get the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#first" target="_self"&gt;First&lt;/A&gt; item of that FeatureSet (line 3) to use in the Intersects function.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// gets addresses that belong to a single parcel
var fs_parcels = FeatureSetByName($map, "parcel layer", ['UPC','OWNER','OWNADD','SITUSADD'])
var targ_parcel = First(Intersects(fs_parcels, $feature)) //target parcel from clicking on point of interest
//console("returns " + Count(targ_parcel)+ " parcels")//gives me a count of 1, as expected
var fs_addr_pts = FeatureSetByName($map, "addr_points",['GeoAddress'])//creates feature set of address points in map
console("returns " + Count(fs_addr_pts))//returns 207,000 records found in featureset
//the next setp fails and doesn't return any features
var parcel_addrs = Intersects(fs_addr_pts, targ_parcel)
Console("returns " + count(parcel_addrs) + " addresses")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 20:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546305#M61843</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-07T20:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546510#M61853</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;I'm not sure who marked this as solved, but this doesn't seem to be working - that line fails to return anything and gives the same 'invalid parameter'. At first i thought it was because there are two 'First' functions, one that handles an array, and another that takes features and returns a feature, but since there is no way to specify which function I'm assuming Arcade figures out what the input and desired result is. Regardless, if you have other thoughts I'd appreciate it.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 13:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546510#M61853</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2024-10-08T13:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546527#M61857</link>
      <description>&lt;P&gt;Arcade will figure out which function you're using from the input parameters.&lt;/P&gt;&lt;P&gt;I just tested this with my data and got the expected return value (this is using an Arcade element).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs_parcels = FeatureSetByName($map, "Enterprise Zone", ['*'])
var targ_parcel = First(Intersects(fs_parcels, $feature)) 
var fs_addr_pts = FeatureSetByName($map, "Sub-Neighborhoods",['*'])
var parcel_addrs = Intersects(fs_addr_pts, targ_parcel)
var output = "returns " + count(parcel_addrs) + " addresses"

return { 
	type : 'text', 
	text : output 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_55e65b.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116737iAE50437D625E2F3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_55e65b.png" alt="Snag_55e65b.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 14:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546527#M61857</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-08T14:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546563#M61860</link>
      <description>&lt;P&gt;completely bizarre - here's the screen shot from running this using the First function and then one removing that function. I feel like I'm missing something really silly here.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clt_cabq_0-1728399225989.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116748iF974998325078132/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clt_cabq_0-1728399225989.png" alt="clt_cabq_0-1728399225989.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clt_cabq_1-1728399276180.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116749i6C45F597013094F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clt_cabq_1-1728399276180.png" alt="clt_cabq_1-1728399276180.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 14:55:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546563#M61860</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2024-10-08T14:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546590#M61863</link>
      <description>&lt;P&gt;You can't use a Feature in the Count function. You can use &lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/#count" target="_self"&gt;Arrays&lt;/A&gt;, &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#count" target="_self"&gt;FeatureSets&lt;/A&gt;, or &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#count" target="_self"&gt;Text&lt;/A&gt; strings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 15:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546590#M61863</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-08T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - in popup get points intersecting polygon when clicking on another point feature</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546639#M61866</link>
      <description>&lt;P&gt;well see? something ridiculously silly.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;thanks for the assist!&amp;nbsp;&lt;/P&gt;&lt;P&gt;code works, i have a little to do to clean it up and add some finesse stuff but the main functionality is there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clt_cabq_0-1728407265022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116766i3030A52A32C6B35C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clt_cabq_0-1728407265022.png" alt="clt_cabq_0-1728407265022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 17:09:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-in-popup-get-points-intersecting-polygon/m-p/1546639#M61866</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2024-10-08T17:09:18Z</dc:date>
    </item>
  </channel>
</rss>

