<?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: Creating a Filtered FeatureSet using Intersect and/or Contains/Within in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1590023#M10808</link>
    <description>&lt;P&gt;It isn't always straight forward and it does confuse some people, especially if you program in several languages, and simply getting the syntax just right is confusing by itself.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 13:22:20 GMT</pubDate>
    <dc:creator>RPGIS</dc:creator>
    <dc:date>2025-02-27T13:22:20Z</dc:date>
    <item>
      <title>Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1586873#M10771</link>
      <description>&lt;P&gt;Hi Community Members,&lt;/P&gt;&lt;P&gt;I'm trying to create a FeatureSet by intersecting it with another FeatureClass, but having problems. BTW the Portal Version is 11.3. The Scenario is fairly simple and I've read the documentation for intersects / Contains / WithIn.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;for Intersects it is :&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Intersects(features, inputGeometry) -&amp;gt; FeatureSet‎&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;For Contains it is:&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Contains(containerGeometry, insideFeatures) -&amp;gt; FeatureSet‎&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;and for Within it is:&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;‎Within(innerGeometry, outerFeatures) -&amp;gt; FeatureSet‎&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Now as per my understanding, all these functions work with Features i.e FeatureSets against a Geometry, which could be a feature.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is what I've done so far:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var MyPortal = Portal("https://xyz.com/portal/");

var tempfs = FeatureSetByPortalItem(
  MyPortal,
  "5cab64be2ea5448aa5b5e220adf7bf05",
  0,
  ["*"],
  true
);

var fsRoads = 
  FeatureSetByPortalItem(
    MyPortal,
    "f4dfa29e2c0947cda6c7b9f2378253fd",
    0,
    ["*"],
    true
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two featureSets, One Contains dissolved buffered Roads i.e. a single Feature and the other FeatureSet contains point Features. I'm trying to get a featureSet by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var myfs = Intersects(tempfs, First(fsRoads))
return (myfs)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var myfs = Within(first(fsRoads), tempfs)
return (myfs)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var myfs = Contains(first(fsRoads), tempfs)
returns (myfs)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but all these do not seem to work, no matter what I do. I've checked the SRIDs of both FEatureSets, they are the same. Counted individual FeatureSets, Counts are Ok. but there is no result. Trying to generate a FeatureSet that could be used for other Items in a Dashboard.&lt;/P&gt;&lt;P&gt;This is the Error I get whenever I test it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Test execution error: Unknown Error. Verify test data.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone point me to the correct solution as I don't want to do it using a for loop, which BTW takes forever to work.&lt;/P&gt;&lt;P&gt;Thanks in advance for all the help.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 11:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1586873#M10771</guid>
      <dc:creator>DNMCSCADA</dc:creator>
      <dc:date>2025-02-19T11:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1586888#M10772</link>
      <description>&lt;P&gt;Try removing the First(&amp;lt;feature&amp;gt;) and simply use the layer. The issue with using first is that it pulls the first record in the table which may not intersect with the other layer. If the layers intersect, then you can then use the first function to get that specific record.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 13:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1586888#M10772</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-02-19T13:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588445#M10792</link>
      <description>&lt;P&gt;Hi RPGIS,&lt;/P&gt;&lt;P&gt;I've tried this already. I used First() in the first place because, in the Arcade document, it is written that there should be one Geometry or a feature and not features.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, the result is the same even if I try it without First().&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 08:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588445#M10792</guid>
      <dc:creator>DNMCSCADA</dc:creator>
      <dc:date>2025-02-24T08:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588636#M10793</link>
      <description>&lt;P&gt;Just out of curiosity, have you tried testing this locally to see if any of the features overlap at all. If nothing overlaps, then regardless of the direction, there won't be any results.&lt;/P&gt;&lt;P&gt;Also, what kind of geometries are you using. If it is points and lines, then that might be the challenge since it would be very difficult to identify whether the points or lines intersect in the first place, but there are ways to identify which is the closest point to a line.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 17:49:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588636#M10793</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-02-24T17:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588845#M10795</link>
      <description>&lt;P&gt;Hi RPGIS,&lt;/P&gt;&lt;P&gt;Thanks for your reply, yes fsTemp is a point feature Class and fsRoads is basically a Dissolved buffer of certain road Classes resulting in a single feature. and yes in pro I can select using spatial operations and there are 1.5K point features that are inside this buffer.&lt;/P&gt;&lt;P&gt;The reason I want to do this for the time being is that I have no way of doing this in Pro that can be automatically updated. and creating a view and accessing it after publishing is too slow for the front-end.&lt;/P&gt;&lt;P&gt;I am also open to suggestions if it can be done in any other way.&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 07:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588845#M10795</guid>
      <dc:creator>DNMCSCADA</dc:creator>
      <dc:date>2025-02-25T07:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588900#M10798</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/707458"&gt;@DNMCSCADA&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;That helps a lot with that information that you provided. So try one of these options below to see which one gets you in the right information that you are looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function FindNull( InputArray ){
    var NonEmptyValues = []
    for( var i = 0; i&amp;lt; Count( InputArray ) ; i++ ){
        if( !IsEmpty( InputArray[ i ] ) ){
            Console( InputArray[ i ] , ' is not empty' )
            Push( NonEmptyValues , InputArray[ i ] ) }
    return NonEmptyValues
    }

var A = Intersects( Geometry( tempfs ) , fsRoads )
if( Count( A ) &amp;gt; 0 ){ A = First( A ) }

var B = Intersects( fsRoads , Geometry( tempfs ) )
if( Count( B ) &amp;gt; 0 ){ B = First( B ) }

var C = Intersects( Geometry( fsRoads ) , tempfs )
if( Count( C ) &amp;gt; 0 ){ C = First( C ) }

var D = Intersects( tempfs , Geometry( fsRoads ) )
if( Count( D ) &amp;gt; 0 ){ D = First( D ) }

var Check = FindNull( [ A , B , C , D ] )
Console( Check )

return Console( Check )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I often get confused at times when it comes to the geometry vs the attributes of the features I am trying to get.&lt;/P&gt;&lt;P&gt;The other thing is the permissions to the layer that you are trying to create which might be keeping you from creating the layer in the first place. That is another potential possibility to consider.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 14:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1588900#M10798</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-03-03T14:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1590013#M10807</link>
      <description>&lt;P&gt;Hi RPGIS,&lt;/P&gt;&lt;P&gt;Thanks for the reply and the code. I will look into the suggestions mentioned in the code you provided and report back with the results. IDK, maybe the ESRI documentation is sometimes confusing, and I am kind of new in JS/Python/Arcade and get confused easily due to the new array and Dict types.&lt;/P&gt;&lt;P&gt;anyway thank for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 13:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1590013#M10807</guid>
      <dc:creator>DNMCSCADA</dc:creator>
      <dc:date>2025-02-27T13:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1590023#M10808</link>
      <description>&lt;P&gt;It isn't always straight forward and it does confuse some people, especially if you program in several languages, and simply getting the syntax just right is confusing by itself.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 13:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1590023#M10808</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-02-27T13:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1591148#M10823</link>
      <description>&lt;P&gt;Hi RPGIS,&lt;/P&gt;&lt;P&gt;BTW where did you get &lt;STRONG&gt;myfs&lt;/STRONG&gt; from in the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if( Count( myfs ) &amp;gt; 0 ){ A = First( A ) }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it from my Code?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 08:54:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1591148#M10823</guid>
      <dc:creator>DNMCSCADA</dc:creator>
      <dc:date>2025-03-03T08:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Filtered FeatureSet using Intersect and/or Contains/Within</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1591205#M10824</link>
      <description>&lt;P&gt;Yes and I forgot to change it to the different letters. I was preoccupied with something and I failed to see that. I will have the code that I sent you updated.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 14:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-a-filtered-featureset-using-intersect-and/m-p/1591205#M10824</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-03-03T14:46:45Z</dc:date>
    </item>
  </channel>
</rss>

