<?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 Help using Arcade FeatureSets to return text in ArcGIS Enterprise Portal Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/help-using-arcade-featuresets-to-return-text/m-p/1359956#M14374</link>
    <description>&lt;P&gt;Hi everyone. I've been working on an Arcade script in Portal 11.1 that is supposed to return a string when a residential building intersecting a selected tax parcel intersects an enterprise zone polygon. The script returns the subset of building features when intersecting the buildings and tax parcels. But when the subset of building features is intersected with the enterprise zone polygon, nothing is returned.&lt;/P&gt;&lt;P&gt;Three screenshots have been included illustrating this concept.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 1&lt;/STRONG&gt; shows a simple script returning the number of buildings intersecting the selected tax parcel.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 2&lt;/STRONG&gt; shows nothing is returned when the buildings inside the tax parcel are intersected with the enterprise zone.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 3&lt;/STRONG&gt; shows an attempt to loop through each building feature and intersect it with the enterprise zone layer, then return the count of buildings. Nothing is counted and the default 0 is returned.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 4&lt;/STRONG&gt; I've written the full script to check for all of the allowable conditions. This script is following the pattern of not returning the required string when any of the conditions are met. The intersecting FeatureSets isn't able to work properly, nor are the conditional statements.&lt;/P&gt;&lt;P&gt;if($feature.InDanville == "Y"){&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; //Create FeatureSet from Enterprise Zone layer&lt;BR /&gt;&amp;nbsp; var ez_layer = FeatureSetByName($map, "Enterprise Zone", ["OBJECTID"], false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Create a negative buffer of the selected Tax Parcel feature&lt;BR /&gt;&amp;nbsp; var parcel_buffer = Buffer($feature, -10, "feet");&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Create a FeatureSet from the Buildings layer&lt;BR /&gt;&amp;nbsp; var bld_layer = FeatureSetByName($map, "Buildings", ["ResidentialUnits"], false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Filter the Buildings FeatureSet by Buildings that have residential units&lt;BR /&gt;&amp;nbsp; var bld_filter = Filter(bld_layer, "ResidentialUnits &amp;gt; 0");&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Intersect the filtered Buildings with the selected Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; var bld_result = Intersects(bld_filter, parcel_buffer);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Intersect the selected Tax Parcel buffered feature with the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; var parcel_inside_ez = Intersects(parcel_buffer, ez_layer);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings intersected the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result &amp;gt; 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return "This residential property is within the enterprise zone." &amp;nbsp;&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings did not intersect the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; else if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result == 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return "This is not a residential property."&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings intersected the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; else if(Count(parcel_inside_ez) == 0 &amp;amp;&amp;amp; Count(bld_result &amp;gt; 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return "This residential property is not within the enterprise zone."&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;else{&lt;BR /&gt;&amp;nbsp; return "This property is not in the city."&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 21:25:18 GMT</pubDate>
    <dc:creator>AdamAull</dc:creator>
    <dc:date>2023-12-12T21:25:18Z</dc:date>
    <item>
      <title>Help using Arcade FeatureSets to return text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/help-using-arcade-featuresets-to-return-text/m-p/1359956#M14374</link>
      <description>&lt;P&gt;Hi everyone. I've been working on an Arcade script in Portal 11.1 that is supposed to return a string when a residential building intersecting a selected tax parcel intersects an enterprise zone polygon. The script returns the subset of building features when intersecting the buildings and tax parcels. But when the subset of building features is intersected with the enterprise zone polygon, nothing is returned.&lt;/P&gt;&lt;P&gt;Three screenshots have been included illustrating this concept.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 1&lt;/STRONG&gt; shows a simple script returning the number of buildings intersecting the selected tax parcel.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 2&lt;/STRONG&gt; shows nothing is returned when the buildings inside the tax parcel are intersected with the enterprise zone.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 3&lt;/STRONG&gt; shows an attempt to loop through each building feature and intersect it with the enterprise zone layer, then return the count of buildings. Nothing is counted and the default 0 is returned.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Image 4&lt;/STRONG&gt; I've written the full script to check for all of the allowable conditions. This script is following the pattern of not returning the required string when any of the conditions are met. The intersecting FeatureSets isn't able to work properly, nor are the conditional statements.&lt;/P&gt;&lt;P&gt;if($feature.InDanville == "Y"){&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; //Create FeatureSet from Enterprise Zone layer&lt;BR /&gt;&amp;nbsp; var ez_layer = FeatureSetByName($map, "Enterprise Zone", ["OBJECTID"], false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Create a negative buffer of the selected Tax Parcel feature&lt;BR /&gt;&amp;nbsp; var parcel_buffer = Buffer($feature, -10, "feet");&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Create a FeatureSet from the Buildings layer&lt;BR /&gt;&amp;nbsp; var bld_layer = FeatureSetByName($map, "Buildings", ["ResidentialUnits"], false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Filter the Buildings FeatureSet by Buildings that have residential units&lt;BR /&gt;&amp;nbsp; var bld_filter = Filter(bld_layer, "ResidentialUnits &amp;gt; 0");&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Intersect the filtered Buildings with the selected Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; var bld_result = Intersects(bld_filter, parcel_buffer);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Intersect the selected Tax Parcel buffered feature with the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; var parcel_inside_ez = Intersects(parcel_buffer, ez_layer);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings intersected the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result &amp;gt; 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return "This residential property is within the enterprise zone." &amp;nbsp;&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings did not intersect the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; else if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result == 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return "This is not a residential property."&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet&lt;BR /&gt;&amp;nbsp; // Check to see if the filtered Buildings intersected the Tax Parcel buffered feature&lt;BR /&gt;&amp;nbsp; else if(Count(parcel_inside_ez) == 0 &amp;amp;&amp;amp; Count(bld_result &amp;gt; 0)){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return "This residential property is not within the enterprise zone."&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;else{&lt;BR /&gt;&amp;nbsp; return "This property is not in the city."&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 21:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/help-using-arcade-featuresets-to-return-text/m-p/1359956#M14374</guid>
      <dc:creator>AdamAull</dc:creator>
      <dc:date>2023-12-12T21:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help using Arcade FeatureSets to return text</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-portal-questions/help-using-arcade-featuresets-to-return-text/m-p/1360298#M14384</link>
      <description>&lt;P&gt;In your if statements, you have misplaced parenthesis for the Count functions on bld_result (lines 1, 7, and 13). And you should have a return if both counts are zero.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result) &amp;gt; 0){
      return "This residential property is within the enterprise zone."  
  }

  // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet
  // Check to see if the filtered Buildings did not intersect the Tax Parcel buffered feature
  else if(Count(parcel_inside_ez) &amp;gt; 0 &amp;amp;&amp;amp; Count(bld_result) == 0){
    return "This is not a residential property."
  }

  // Check to see if the selected Tax Parcel buffered feature intersected the Enterprise Zone FeatureSet
  // Check to see if the filtered Buildings intersected the Tax Parcel buffered feature
  else if(Count(parcel_inside_ez) == 0 &amp;amp;&amp;amp; Count(bld_result) &amp;gt; 0){
    return "This residential property is not within the enterprise zone."
  } 
  // If both counts are zero
  else {
    return "This property is not residential and is not within the enterprise zone."
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 15:22:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-portal-questions/help-using-arcade-featuresets-to-return-text/m-p/1360298#M14384</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-12-13T15:22:50Z</dc:date>
    </item>
  </channel>
</rss>

