<?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: Attribute Rule - Sequential Number in a Text Field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364556#M76762</link>
    <description>&lt;P&gt;You need to query the historic featureclass to obtain the last id, you can do so by referencing the FC using FeatureSetByName&lt;BR /&gt;&lt;BR /&gt;Then you can get the last id from that featureclass using a combination of First(), OrderBy(), and Filter()&lt;BR /&gt;&lt;BR /&gt;Once you obtain the last ID, add +1 and perform your concatenation.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2023 18:12:44 GMT</pubDate>
    <dc:creator>Raul</dc:creator>
    <dc:date>2023-12-27T18:12:44Z</dc:date>
    <item>
      <title>Attribute Rule - Sequential Number in a Text Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364519#M76755</link>
      <description>&lt;P&gt;I've created a attribute rule to give every new feature a custom ID, the first part of the ID is&amp;nbsp;1234AB and the next part needs to be a 4 digit sequential number starting with 0001 (1234AB0001). I have a history feature I need it to reference for duplicates, so if the custom ID field in the history feature already has ID&amp;nbsp;1234AB0001 then the rule would automatically bump up 1 number and assigned&amp;nbsp;1234AB0002. Any ideas on how to accomplish this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364519#M76755</guid>
      <dc:creator>avonmoos</dc:creator>
      <dc:date>2023-12-27T16:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Sequential Number in a Text Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364556#M76762</link>
      <description>&lt;P&gt;You need to query the historic featureclass to obtain the last id, you can do so by referencing the FC using FeatureSetByName&lt;BR /&gt;&lt;BR /&gt;Then you can get the last id from that featureclass using a combination of First(), OrderBy(), and Filter()&lt;BR /&gt;&lt;BR /&gt;Once you obtain the last ID, add +1 and perform your concatenation.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 18:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364556#M76762</guid>
      <dc:creator>Raul</dc:creator>
      <dc:date>2023-12-27T18:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Sequential Number in a Text Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364622#M76776</link>
      <description>&lt;P&gt;Here is an attribute rule that I use for that:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(isempty($feature.ID) &amp;amp;&amp;amp; $feature.Layer == "ST-DYCL"){

var vals = FeatureSetByName($datastore,"PW_Pro.DBO.Striping",['ID','LENGTH_FT'],false)
var DYCLvals = Filter(vals, "ID LIKE 'DYCL%'")
var numarray = []

for (var n in DYCLvals){
    var nn = Number(Replace(n.ID, 'DYCL',''))
    Push(numarray, nn)
}
var maxnum = Max(numarray)
var maxtext = Concatenate('DYCL',(Text(maxnum + 1, '00000')))

return maxtext
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My ID field for this data starts with "DYCL", so this filters for all values that start with that, strips(Replace) the DYCL from it and converts to a number, finds the max value, concatenates that back with the DYCL with incremented number and returns it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 21:59:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364622#M76776</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-12-27T21:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule - Sequential Number in a Text Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364992#M76810</link>
      <description>&lt;P&gt;I'll give this a try Rhett! I should have just gave you a call on this. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 16:36:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-sequential-number-in-a-text-field/m-p/1364992#M76810</guid>
      <dc:creator>avonmoos</dc:creator>
      <dc:date>2023-12-29T16:36:07Z</dc:date>
    </item>
  </channel>
</rss>

