<?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: Returning attributes from another layer via Arcade intersect? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309767#M53468</link>
    <description>&lt;P&gt;The below code is what I recently put together to achieve the same outcome with use of an Attribute Rule. Josh's suggestion is also valid.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var basins = FeatureSetByName ($datastore, "Watersheds_2017", ["WATERSHED_CODE"],true);

var matchedBasin = First(Intersects(basins, Geometry($feature)));

if(matchedBasin == null) {return null}

else {return matchedBasin.WATERSHED_CODE};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2023 20:36:27 GMT</pubDate>
    <dc:creator>drWood</dc:creator>
    <dc:date>2023-07-19T20:36:27Z</dc:date>
    <item>
      <title>Returning attributes from another layer via Arcade intersect?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309495#M53448</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating an Acrade expression that will allow me to return attribute information from another layer via an intersect. In this case wetland information will be returned when a parcel is clicked on. My current expression works but I cant seem to figure out how to return text that says "No Wetland" when there is no intersecting wetland. Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arcade Expression:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var points =FeatureSetByName($map,"WetlandsLayer");
var countp = Intersects(points,$feature);

var result = "";
for (var item in countp){
var id = item["LABEL12"];
result += id + ' '
}
return result&lt;/LI-CODE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 13:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309495#M53448</guid>
      <dc:creator>DaveK</dc:creator>
      <dc:date>2023-07-19T13:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Returning attributes from another layer via Arcade intersect?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309512#M53449</link>
      <description>&lt;P&gt;Easy enough! You can check to see how many features are in the intersection, and return a different value when it's 0.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var points =FeatureSetByName($map,"WetlandsLayer");
var countp = Intersects(points,$feature);

if (Count(countp) &amp;lt; 1) {
  return 'No Wetlands'
}

var result = "";
for (var item in countp){
  var id = item["LABEL12"];
  result += id + ' '
}
return result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Jul 2023 14:10:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309512#M53449</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-07-19T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Returning attributes from another layer via Arcade intersect?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309767#M53468</link>
      <description>&lt;P&gt;The below code is what I recently put together to achieve the same outcome with use of an Attribute Rule. Josh's suggestion is also valid.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var basins = FeatureSetByName ($datastore, "Watersheds_2017", ["WATERSHED_CODE"],true);

var matchedBasin = First(Intersects(basins, Geometry($feature)));

if(matchedBasin == null) {return null}

else {return matchedBasin.WATERSHED_CODE};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 20:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/returning-attributes-from-another-layer-via-arcade/m-p/1309767#M53468</guid>
      <dc:creator>drWood</dc:creator>
      <dc:date>2023-07-19T20:36:27Z</dc:date>
    </item>
  </channel>
</rss>

