<?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 Calling Queried Feature in Attribute Rules in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219218#M60741</link>
    <description>&lt;P&gt;I am using ArcGIS Pro 2.8 to build an attribute rule for a point feature that will count the lines of another feature class intersecting each point. Seems easy enough but I need it to count only certain lines. We have a model to do this in post processing but I would like to move this to our live data editing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a valid expression for counting intersecting lines until I try and add the query. Is there a way to call only the lines of my feature that match certain attribute. Sample of one of my failed attempts below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var cable = FeatureSetByName ($datastore, "CableDD", ["Cable_Category"], 'Drop')&lt;BR /&gt;var intersectLayer = Intersects(cable, $feature)&lt;BR /&gt;var cnt = Count(intersectLayer)&lt;BR /&gt;if (cnt &amp;gt; 0) {&lt;BR /&gt;return cnt&lt;BR /&gt;} else {&lt;BR /&gt;return "error"&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 04:05:00 GMT</pubDate>
    <dc:creator>AshleyMcKay</dc:creator>
    <dc:date>2022-10-06T04:05:00Z</dc:date>
    <item>
      <title>Calling Queried Feature in Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219218#M60741</link>
      <description>&lt;P&gt;I am using ArcGIS Pro 2.8 to build an attribute rule for a point feature that will count the lines of another feature class intersecting each point. Seems easy enough but I need it to count only certain lines. We have a model to do this in post processing but I would like to move this to our live data editing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a valid expression for counting intersecting lines until I try and add the query. Is there a way to call only the lines of my feature that match certain attribute. Sample of one of my failed attempts below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var cable = FeatureSetByName ($datastore, "CableDD", ["Cable_Category"], 'Drop')&lt;BR /&gt;var intersectLayer = Intersects(cable, $feature)&lt;BR /&gt;var cnt = Count(intersectLayer)&lt;BR /&gt;if (cnt &amp;gt; 0) {&lt;BR /&gt;return cnt&lt;BR /&gt;} else {&lt;BR /&gt;return "error"&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 04:05:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219218#M60741</guid>
      <dc:creator>AshleyMcKay</dc:creator>
      <dc:date>2022-10-06T04:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Queried Feature in Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219233#M60743</link>
      <description>&lt;P&gt;In the FeatureSetByName() function, the "drop" is in the wrong place. Is this a field or is this the value of Cable_Category you want to count?&lt;/P&gt;&lt;P&gt;Also, trying to return "error" (a string) for an integer field will give you an error. If your field is a string field, it will work, though.&lt;/P&gt;&lt;P&gt;if you want to reject the edit when there are no intersecting lines, you can return a dictionary with the key errorMessage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, assuming "Drop" is the value you want to filter and you want to reject the edit if the point doesn't intersect any lines:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var cable = FeatureSetByName ($datastore, "CableDD", ["Cable_Category"], true)
var cableDrop = Filer(cable, "Cable_Category = 'Drop'")
var intersectLayer = Intersects(cableDrop, $feature)
var cnt = Count(intersectLayer)
if (cnt &amp;gt; 0) {
    return cnt
}
return {"errorMessage": "No intersecting lines"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 07:51:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219233#M60743</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-06T07:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Queried Feature in Attribute Rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219491#M60774</link>
      <description>&lt;P&gt;Thank you! This worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var cable = FeatureSetByName ($datastore,"Clearwave_KS.GISOWNER.Fiber_Cable_LLD", ["Cable_Category"], true)&lt;BR /&gt;var cableDrop = Filter(cable, "Cable_Category = 'Drop'")&lt;BR /&gt;var intersectLayer = Intersects(cableDrop, $feature)&lt;BR /&gt;var cnt = Count(intersectLayer)&lt;BR /&gt;return cnt&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calling-queried-feature-in-attribute-rules/m-p/1219491#M60774</guid>
      <dc:creator>AshleyMcKay</dc:creator>
      <dc:date>2022-10-06T17:26:47Z</dc:date>
    </item>
  </channel>
</rss>

