<?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 Intersect Returns Null Field Values in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174737#M46086</link>
    <description>&lt;P&gt;Hello, thanks for your reply. Please see below the new error that is thrown from this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Execution Error:Runtime Error: Cannot call member method on null. Name of Field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 19:00:23 GMT</pubDate>
    <dc:creator>MulfordnSons</dc:creator>
    <dc:date>2022-05-17T19:00:23Z</dc:date>
    <item>
      <title>Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174652#M46083</link>
      <description>&lt;P&gt;I have two layers: A layer of all tax parcels, and a layer of a subset of all the tax parcels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use Intersect in arcade to return a featureSet that I can then use to inject a field from the subset layer in the pop-up of the layer with all the tax parcels. However, it is returning Null field values, even though there are geometries that clearly overlap (as they are identical). Please see below:&lt;/P&gt;&lt;P&gt;var parcel = Intersects(FeatureSetByName($map,"Name of layer with subset of all tax parcels"), $feature);&lt;/P&gt;&lt;P&gt;for (var f in parcel){&lt;BR /&gt;return f.NameOfField&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;returns empty result (shown in attached photo).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any obvious reason someone can see this is happening?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 16:43:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174652#M46083</guid>
      <dc:creator>MulfordnSons</dc:creator>
      <dc:date>2022-05-17T16:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174705#M46084</link>
      <description>&lt;P&gt;Since they are identical,&amp;nbsp; there should only one parcel overlapping at a time, so grab the first one.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var parcel = First(Intersects(FeatureSetByName($map,"Name of layer with subset of all tax parcels"), $feature))
return parcel.NameOfField&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 17:39:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174705#M46084</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-05-17T17:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174737#M46086</link>
      <description>&lt;P&gt;Hello, thanks for your reply. Please see below the new error that is thrown from this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Execution Error:Runtime Error: Cannot call member method on null. Name of Field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 19:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174737#M46086</guid>
      <dc:creator>MulfordnSons</dc:creator>
      <dc:date>2022-05-17T19:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174753#M46088</link>
      <description>&lt;P&gt;Did you make sure the FeatureSet you're retrieving contains any features?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var test = FeatureSetByName($map,"Name of layer with subset of all tax parcels");
console(Count(test));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 19:03:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174753#M46088</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-05-17T19:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174758#M46089</link>
      <description>&lt;P&gt;You can always test for Null/Empty values and proceeded accordingly:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var parcel = First(Intersects(FeatureSetByName($map,"Name of layer with subset of all tax parcels"), $feature))

if (IsEmpty(parcel.NameOfField)){
    return Null
}  
else {
    return parcel.NameOfField
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, if you know there is overlap, something is not right as it should be returning something.&amp;nbsp; As suggested by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;above, can help to get count, etc. using the &lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#console" target="_self"&gt;Console()&lt;/A&gt; option that will output to the Messages window in the Arcade editor.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 19:12:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174758#M46089</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-05-17T19:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174962#M46093</link>
      <description>&lt;P&gt;When you test your Arcade expression, it only checks one feature (I think it's the first). So if that feature doesn't intersect a feature of your filtered layer, you will get an empty intersect feature set. Your loop will run 0 times and then the expression will return null. If you call First() on an empty feature set, the result is null, which is why you get the ExecutionError when you try to return null.Field&lt;/P&gt;&lt;P&gt;Something like this should do the trick:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var filtered_parcels = Intersects(FeatureSetByName($map,"Name of layer with subset of all tax parcels"), $feature);

var parcel = First(filtered_parcels) // get the first feature

// if filtered_parcels is empty, parcel is null
// in that case, return a default value
if(parcel == null) {
    return "No intersecting subset parcel found."
}
// else return the field value
return parcel.NameOfField&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you test that expression, it should show the default result. When you actually open a popup, it should show either the default result or the field of the subset layer, depending on whether there is a subset parcel intersecting the queried feature.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 08:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174962#M46093</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-18T08:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1216375#M48079</link>
      <description>&lt;P&gt;It worked. Thank you.&lt;/P&gt;&lt;P class="lia-align-right"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;A href="https://krunkerio.io" target="_self"&gt;&lt;FONT color="#FFFFFF"&gt;krunker&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 04:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1216375#M48079</guid>
      <dc:creator>skunkpup</dc:creator>
      <dc:date>2022-09-27T04:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1302624#M53054</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;I am using your code in a similar fashion,&amp;nbsp;, it's working great if I click inside my Zone (blue area) but if I click outside I get the following warning message. Technically, since I don't have a Zone to intersect I should be getting a "NULL" value correct?&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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="DominicRoberge2_0-1687548057336.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74068iCEFF67CD960667C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DominicRoberge2_0-1687548057336.png" alt="DominicRoberge2_0-1687548057336.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;// Get other layer from datastore 
var other_layer = FeatureSetByName($map, "Tree Inventory Areas")
// Intersect layer and feature, use `First` to take the top feature
var intersectFeat = Intersects($feature, other_layer)
var xs_feat = First(intersectFeat)
var Zone =xs_feat["zone"]
var noZone = "999"

if(xs_feat == null) {
    return noZone
}
//else 
return Zone&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 19:30:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1302624#M53054</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-06-23T19:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Intersect Returns Null Field Values</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1302644#M53057</link>
      <description>&lt;P&gt;Sorry, I solved my problem:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;// Get other layer from datastore
var other_layer = FeatureSetByName($map, "Tree Inventory Areas")
// Intersect layer and feature, use `First` to take the top feature
var intersectFeat = Intersects($feature, other_layer)

//check for intersects
var intersect_count = Count(Intersects(other_layer, $feature))
var noZone = "999"
if(intersect_count ==0) {
    return noZone
}

var xs_feat = First(intersectFeat)
var Zone =xs_feat["zone"]

//else
return Zone&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 20:02:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1302644#M53057</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2023-06-23T20:02:57Z</dc:date>
    </item>
  </channel>
</rss>

