<?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: FeatureSetByName for multiple Polygon Layers in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1256216#M50239</link>
    <description>&lt;P&gt;Thank you Johannes,&lt;/P&gt;&lt;P&gt;What is the difference between $datastore and $map...? Does that address the fact that the layers are not my own?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code with the layers i am using:&lt;/P&gt;&lt;P&gt;//define the zoning layers and their zone fields&lt;BR /&gt;var zone_layers = [&lt;BR /&gt;FeatureSetByName($map,"Mendocino County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Lake County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Napa County Parcels with Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Monterey County Parcels", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Santa Barbara County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Sonoma County Parcels with Ownership", ["*"], false),&lt;BR /&gt;]&lt;BR /&gt;var zone_fields = [&lt;BR /&gt;"BASEZONE1",&lt;BR /&gt;"base_zone",&lt;BR /&gt;"Land_Use",&lt;BR /&gt;"landuse",&lt;BR /&gt;"usectype",&lt;BR /&gt;]&lt;BR /&gt;var zones = []&lt;BR /&gt;// loop through the layers&lt;BR /&gt;for(var i in zone_layers) {&lt;BR /&gt;//get the first intersecting zone, abort if none found&lt;BR /&gt;var zone = first(intersects(zone_layers[i], $feature))&lt;BR /&gt;if(zone == null) {continue}&lt;BR /&gt;//append the zone's zone field value&lt;BR /&gt;Push(zones, zone[zone_fields[i]])&lt;BR /&gt;}&lt;BR /&gt;//concatenate and return&lt;BR /&gt;return Concatenate(zones, ", ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some of the fields do display such as the "Base Zones" but for a couple of the county layers the "landuse and usetype" are blank, but in the layer there is a value for those fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;are my zone_fields list not correct?&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 18:39:03 GMT</pubDate>
    <dc:creator>FrancisHourigan1</dc:creator>
    <dc:date>2023-02-08T18:39:03Z</dc:date>
    <item>
      <title>FeatureSetByName for multiple Polygon Layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1255973#M50216</link>
      <description>&lt;P&gt;I want to create a pop-up that shows the zoning type within a polygon boundary from multiple different county zoning layers.&lt;/P&gt;&lt;P&gt;So far I have found a lot of examples online of using Arcade FeatureSetByName to call one layer that intersects a polygon layer. However, is there a way to access attributes in different layers that intersect the original polygon layer?&lt;/P&gt;&lt;P&gt;Here is the scenario, I have a polygon boundary that is national (USA) and is an ownership boundary. I have in my map 5 other layers that are not owned by me because they are county parcel/zoning layers. I want to call all 5 layers that intersect with a particular ownership polygon. So ideally when I click the ownership polygon it will show me a list of zoning codes that are within it (no matter which county I am in it will pull only the zones that intersect my original polygon layer).&lt;/P&gt;&lt;P&gt;Is there a way to loop through the 5 layers and their zoning attributes to display only the zone that is currently intersecting the polygon boundary I click on?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;I'm looking at you &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 01:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1255973#M50216</guid>
      <dc:creator>FrancisHourigan1</dc:creator>
      <dc:date>2023-02-08T01:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByName for multiple Polygon Layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1256034#M50217</link>
      <description>&lt;P&gt;Probably not the most efficient way, but it gets the job done:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// define the zoning layers and their zone fields
var zoning_layers = [
    FeaturesetByName($datastore, "TestPolygons", ["*"], false),
    FeaturesetByName($datastore, "TestPolygons", ["*"], false),
    FeaturesetByName($datastore, "TestPolygons", ["*"], false),
    FeaturesetByName($datastore, "TestPolygons", ["*"], false),
    ]
var zoning_fields = [
    "TextField",
    "IntegerField",
    "GlobalID",
    "OBJECTID",
    ]

var zones = []
// loop through the layers
for(var i in zoning_layers) {
    // get the first intersecting zone, abort if none found
    var zone = First(Intersects(zoning_layers[i], $feature))
    if(zone == null) { continue }
    // append the zone's zoning field value
    Push(zones, zone[zoning_fields[i]])
}
// concatenate and return
return Concatenate(zones, ", ")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Feb 2023 06:40:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1256034#M50217</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-02-08T06:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByName for multiple Polygon Layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1256216#M50239</link>
      <description>&lt;P&gt;Thank you Johannes,&lt;/P&gt;&lt;P&gt;What is the difference between $datastore and $map...? Does that address the fact that the layers are not my own?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code with the layers i am using:&lt;/P&gt;&lt;P&gt;//define the zoning layers and their zone fields&lt;BR /&gt;var zone_layers = [&lt;BR /&gt;FeatureSetByName($map,"Mendocino County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Lake County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Napa County Parcels with Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Monterey County Parcels", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Santa Barbara County Parcels w Ownership", ["*"], false),&lt;BR /&gt;FeatureSetByName($map,"Sonoma County Parcels with Ownership", ["*"], false),&lt;BR /&gt;]&lt;BR /&gt;var zone_fields = [&lt;BR /&gt;"BASEZONE1",&lt;BR /&gt;"base_zone",&lt;BR /&gt;"Land_Use",&lt;BR /&gt;"landuse",&lt;BR /&gt;"usectype",&lt;BR /&gt;]&lt;BR /&gt;var zones = []&lt;BR /&gt;// loop through the layers&lt;BR /&gt;for(var i in zone_layers) {&lt;BR /&gt;//get the first intersecting zone, abort if none found&lt;BR /&gt;var zone = first(intersects(zone_layers[i], $feature))&lt;BR /&gt;if(zone == null) {continue}&lt;BR /&gt;//append the zone's zone field value&lt;BR /&gt;Push(zones, zone[zone_fields[i]])&lt;BR /&gt;}&lt;BR /&gt;//concatenate and return&lt;BR /&gt;return Concatenate(zones, ", ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some of the fields do display such as the "Base Zones" but for a couple of the county layers the "landuse and usetype" are blank, but in the layer there is a value for those fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;are my zone_fields list not correct?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 18:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/featuresetbyname-for-multiple-polygon-layers/m-p/1256216#M50239</guid>
      <dc:creator>FrancisHourigan1</dc:creator>
      <dc:date>2023-02-08T18:39:03Z</dc:date>
    </item>
  </channel>
</rss>

