<?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 Unable to pass a Filter Feature Set through Intersects? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/unable-to-pass-a-filter-feature-set-through/m-p/1082691#M43733</link>
    <description>&lt;P&gt;I'm setting up an attribute rule to pick a field from the first nearby feature and automatically enter it into a field on the target feature class. However, I want to add a&amp;nbsp; Filter to the nearby feature class so it will only pull from feature classes with a certain query.&lt;/P&gt;&lt;P&gt;I'm using the below code for it. However, I get a "General evaluation error" when trying to pass the filter into the Intersects code. I'm not sure why it won't take a filtered feature set as the Filter should be outputting a featureset object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Calculation Rule
//Populate the edited feature's Street Address with a value from the Service FC

//Triggers:  Insert

// Value to copy from the intersected feature
var intersecting_field = 'MXLOCATION';

//Field rule is assigned to in the Attribute Rule
var feature_field = 'MAINMXLOCATION';

// Create feature set to the intersecting class using the GDB Name
var polylineFC = FeatureSetByName($datastore, 'distmain_UAT', [intersecting_field, "MXDISPLAY"], true);

// Filter feature set by active main only (test with Material steel)
var main_filter = Filter(polylineFC, "MXDISPLAY = Y");

// Buffer function for intersect
var featBuf = Buffer($Feature, 5, "meters");

// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Intersects(main_filter, featBuf));

// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)
{
    return $feature.MAINMXLOCATION;
}

// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature[intersecting_field]))
{
    return $feature[feature_field];
}

// Return the intersected features value
return intersected_feature[intersecting_field];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 14:26:01 GMT</pubDate>
    <dc:creator>RDSpire</dc:creator>
    <dc:date>2021-07-26T14:26:01Z</dc:date>
    <item>
      <title>Unable to pass a Filter Feature Set through Intersects?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/unable-to-pass-a-filter-feature-set-through/m-p/1082691#M43733</link>
      <description>&lt;P&gt;I'm setting up an attribute rule to pick a field from the first nearby feature and automatically enter it into a field on the target feature class. However, I want to add a&amp;nbsp; Filter to the nearby feature class so it will only pull from feature classes with a certain query.&lt;/P&gt;&lt;P&gt;I'm using the below code for it. However, I get a "General evaluation error" when trying to pass the filter into the Intersects code. I'm not sure why it won't take a filtered feature set as the Filter should be outputting a featureset object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Calculation Rule
//Populate the edited feature's Street Address with a value from the Service FC

//Triggers:  Insert

// Value to copy from the intersected feature
var intersecting_field = 'MXLOCATION';

//Field rule is assigned to in the Attribute Rule
var feature_field = 'MAINMXLOCATION';

// Create feature set to the intersecting class using the GDB Name
var polylineFC = FeatureSetByName($datastore, 'distmain_UAT', [intersecting_field, "MXDISPLAY"], true);

// Filter feature set by active main only (test with Material steel)
var main_filter = Filter(polylineFC, "MXDISPLAY = Y");

// Buffer function for intersect
var featBuf = Buffer($Feature, 5, "meters");

// Intersect the edited feature with the feature set and retrieve the first feature
var intersected_feature = First(Intersects(main_filter, featBuf));

// Check to make sure there was an intersected feature, if not, return the original value
if (intersected_feature == null)
{
    return $feature.MAINMXLOCATION;
}

// If the intersected feature is null, return the original value
if (IsEmpty(intersected_feature[intersecting_field]))
{
    return $feature[feature_field];
}

// Return the intersected features value
return intersected_feature[intersecting_field];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:26:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/unable-to-pass-a-filter-feature-set-through/m-p/1082691#M43733</guid>
      <dc:creator>RDSpire</dc:creator>
      <dc:date>2021-07-26T14:26:01Z</dc:date>
    </item>
  </channel>
</rss>

