<?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 Attribute Rules to Create Sequential Number within Quads in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553910#M89650</link>
    <description>&lt;P&gt;Sorry, I used the incorrect variable. This should work&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var containingQuad = First(Intersects(quad, $feature));&lt;/LI-CODE&gt;&lt;P&gt;You don't need to get the Geometry of the feature, in addition.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2024 18:46:09 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-10-30T18:46:09Z</dc:date>
    <item>
      <title>Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553874#M89645</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using Attribute Rules and want to automate assigning numbers to newly created layers within a polygon. Eg. If I create a point in quad 267N, I want to look for the last number used for that point feature within that quad, and assign it the next sequential number.&amp;nbsp; The script that I am working on returned an error when verifying, "Invalid expression. Error on line 9. String type expected"&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;// Layers
var valves = FeatureSetByName($datastore, "dwSystemValve");
var quad = FeatureSetByName($datastore, "AtlasGrid_AtlasBook");

// Get the geometry of the current valve
var valveGeometry = Geometry($feature);

// Find the quad that contains the current valve
var containingQuad = First(Intersects(quad, $feature));

// If no quad is found, return an error or default value
if (IsEmpty(containingQuad)) {
return "No quad found";
}

// Get the quad sheet number of the current quad
var sheetID = containingQuad.SHEET;

// Query valves within the same quad
var valvesInQuad = Filter(valves, "SHEET = @sheetID");

// If no valves exist in the quad, start from 1
if (IsEmpty(valvesInQuad)) {
return 1;
}

// Find the highest valve number in the quad
var maxValve = Max(valvesInQuad, "NUM");

// Return the next available number
return maxValve +1;&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>Wed, 30 Oct 2024 19:00:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553874#M89645</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2024-10-30T19:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553881#M89646</link>
      <description>&lt;P&gt;You don't need the Filter function in line 9.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var containingQuad = First(Intersects(valveGeometry, Geometry($feature)));&lt;/LI-CODE&gt;&lt;P&gt;In lines 12 and 17, you use the variable currentQuad. Shouldn't that be containingQuad?&lt;/P&gt;&lt;P&gt;Consider moving the if statement in line 26 to line 21, since you can evaluate whether there are any values found before trying to get the max value.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 18:13:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553881#M89646</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-30T18:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553897#M89647</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I removed the Filter function in line 9 and get a "Invalid expression. Error on line 9. Expected array or feature set"&lt;/P&gt;&lt;P&gt;Thank you for catching typos in line 12 and 17.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 18:32:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553897#M89647</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2024-10-30T18:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553910#M89650</link>
      <description>&lt;P&gt;Sorry, I used the incorrect variable. This should work&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var containingQuad = First(Intersects(quad, $feature));&lt;/LI-CODE&gt;&lt;P&gt;You don't need to get the Geometry of the feature, in addition.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 18:46:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1553910#M89650</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-30T18:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554000#M89664</link>
      <description>&lt;P&gt;Encountered and error in line 28, "Field not found SHEET".&lt;/P&gt;&lt;P&gt;Is expression in line 28 looking for SHEET in the valve layer? That field does not exist in the valve layer. It is in the quad layer.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 21:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554000#M89664</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2024-10-30T21:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554175#M89681</link>
      <description>&lt;P&gt;The way you have the Filter written in this line, it's expecting the valve layer to have a SHEET field.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var valvesInQuad = Filter(valves, "SHEET = @sheetID");&lt;/LI-CODE&gt;&lt;P&gt;Do you have a field in the valve layer that contains that related sheetID values from the quad layer? Or do you need to use the &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#contains" target="_self"&gt;Contains&lt;/A&gt; function to select the valves within the quad?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 12:57:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554175#M89681</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-31T12:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Attribute Rules to Create Sequential Number within Quads</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554253#M89690</link>
      <description>&lt;P&gt;Valve layer does not contain sheetID.&amp;nbsp; I believe using the Contains function is what I am looking for.&amp;nbsp; I need this process to only look at valves within the quad the new valve is created.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 14:25:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-attribute-rules-to-create-sequential-number/m-p/1554253#M89690</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2024-10-31T14:25:42Z</dc:date>
    </item>
  </channel>
</rss>

