<?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 Rules: NextSequenceValue in a file database environment.  in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70688#M2955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your expression fires on update you'll need to add a bit more logic to this script:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the inspection flag field is empty or set to false you'll return the current feature's FlagID value.&lt;/LI&gt;&lt;LI&gt;If the FlagID is already populated, return the current feature's flag ID value.&lt;/LI&gt;&lt;LI&gt;Then, and only then, should you return the next sequence value.&lt;/LI&gt;&lt;LI&gt;If your "True/False" domain is actually for an integer field you may need to change your check to either compare the feature value against the underlying domain value ($feature.INSPFLAG==1), or dynamically compare against the coded value (DomainName($feature,"INSPFLAG") == "True").&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2020 19:39:36 GMT</pubDate>
    <dc:creator>RobertKrisher</dc:creator>
    <dc:date>2020-03-03T19:39:36Z</dc:date>
    <item>
      <title>Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70675#M2942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attempting to create sequential IDs for managing above ground assets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I successfully create the database sequence and have been working with two scripts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Returns zeros in the FID field&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;var FID = $feature.FID;&lt;BR /&gt; ($feature.FID == 1)&lt;BR /&gt; return "SP-" + NextSequenceValue("Traffic_SignalPole_ID")&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;2.) The FID values remain Null&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var FID = $feature.FID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(FID == 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return "SP-" + NextSequenceValue("Traffic_SignalPole_ID")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If is put an "if" before the second line regardless, the field value will be null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when I check the table in arc catalog is shows that the sequence is adding to the database table, but is still not being appended to the feature its self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/479933_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70675#M2942</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T14:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70676#M2943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's take a look at the expression.&amp;nbsp; I'm assuming this is some kind of immediate or batch calculation rule, which means that every time this expression fires the value returned from it will replace the value in your ID field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you're trying to add in a test to see if the value is already populated, but because the statement isn't included in an if statement that means that it isn't controlling logic at all.&amp;nbsp; Here is an example of an expression that will only calculate a new sequence value if the field is empty.&amp;nbsp; In this case I assigned it as an immediate calculation rule on the "my_id" field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isempty($feature.my_id))&amp;nbsp;//If the field is empty&lt;BR /&gt; return concatenate("SP-",nextsequencevalue("Test")); //calculate a new id&lt;BR /&gt;else //otherwise&lt;BR /&gt; return $feature.my_id //return the original value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a screenshot of a few features I created using this rule.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Features Creating Using Expression" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/479936_sequence.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:19:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70676#M2943</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-01-30T16:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70677#M2944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would I need to create a new database sequence, since I have made many attempts as shown in the ArcCatalog table screenshot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After using the script you proved I am still getting "0" in the FID field, but the sequence counter in the catalog table continues to increase?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:30:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70677#M2944</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70678#M2945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's just focus on the geodatabase testing first, that way you can work out all the issues locally before pushing it all to enterprise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you include the new expressions you're now using (with your field / sequence names) along with additional information about how the rule is configured?&amp;nbsp; It is just assigned to fire on insert? update?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70678#M2945</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-01-30T16:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70679#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.)&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;if(isempty($feature.FID)) //If the field is empty&lt;BR /&gt;return concatenate("SP-",nextsequencevalue("Traffic_SignalPole_ID")); //calculate a new id&lt;BR /&gt;else //otherwise&lt;BR /&gt;return $feature.FID //return the original value&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;2.)&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;if(isempty($feature.FID)) //If the field is empty&lt;BR /&gt;return "SP-"+nextsequencevalue("Traffic_SignalPole_ID"); //calculate a new id&lt;BR /&gt;else //otherwise&lt;BR /&gt;return $feature.FID //return the original value&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;The field is: FID&lt;/P&gt;&lt;P&gt;Only assigned to fire on insert.&lt;/P&gt;&lt;P&gt;The rules is an immediate calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:46:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70679#M2946</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T16:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70680#M2947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll make some assumptions about the questions you didn't answer (it's an immediate calculation rule configured to fire on insert).&amp;nbsp; Does your feature have a default value set on the field?&amp;nbsp; Try adding logic to the check so it looks for empty OR your default value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;if(isempty($feature.FID) || $feature.FID=="0") //If the field is empty or has the default value&lt;/SPAN&gt;&lt;BR style="background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;return concatenate("SP-",nextsequencevalue("Traffic_SignalPole_ID")); //calculate a new id&lt;/SPAN&gt;&lt;BR style="background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;else //otherwise&lt;/SPAN&gt;&lt;BR style="background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;" /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;return $feature.FID //return the original value&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70680#M2947</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-01-30T16:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70681#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The FID field data type is "Long", with the concatenate function is this okay or would it need to be changed to "String" to accommodate for the addition of text characters to the field values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 17:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70681#M2948</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T17:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70682#M2949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the data type for the FID field to "String"&amp;nbsp; and after using the script you provided&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isempty($feature.FID) || $feature.FID=="0") //If the field is empty or has the default value&lt;BR /&gt;return concatenate("SP-"+ nextsequencevalue("Traffic_SignalPole_ID")); //calculate a new id&lt;BR /&gt;else //otherwise&lt;BR /&gt;return $feature.FID //return the original value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FID field is populated with values, but to my knowledge so far they seem to be random numbers. The positive thing is that it is returning values, now I am just trying to figure out how / where in the script this may be happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also on a weird note, now when I create new features, there do not display, but are still selectable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/479948_Capture2.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 17:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70682#M2949</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T17:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70683#M2950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some tinkering I was able to successfully populate unique IDs using this script.&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;if(isempty($feature.FID)) //If the field is empty or has the default value&lt;BR /&gt;return concatenate("SP-" + nextsequencevalue("Traffic_SignalPole_ID")); //calculate a new id&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------------&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/479950_Capture3.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70683#M2950</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T18:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70684#M2951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:25:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70684#M2951</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-01-30T18:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70685#M2952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your time and help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there currently a tool or script that resets the sequences or is the point to set constraints and validations so mis-numberings do not happen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70685#M2952</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-30T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70686#M2953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gaps in the numbers are something that will occur naturally as features are deleted or edits are undone, but the sequence itself will ensure that the values that it generates are unique.&amp;nbsp; If you're worried about your users manipulating the data and creating duplicate numbers,&amp;nbsp;you could create an attribute constraint or validation rule that ensures that the numbers are unique.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 20:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70686#M2953</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-01-30T20:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70687#M2954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to do something very similar to Brian but am stumbling with my Arcade expression.&amp;nbsp; I have 2 fields: "INSPFLAG" and "FlagID".&amp;nbsp; The former is a True/False domain while I am trying to make the latter an auto-incremented field.&amp;nbsp; If the&amp;nbsp;"INSPFLAG" value is set to True, I want the "FlagID" to auto-increment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a database sequence for the "FlagID" field (named "FlagID_Sequence); I've set the beginning value to 300 (for testing purposes because I already have some records in the table) with an increment of 1.&amp;nbsp; This is the arcade script I thought would work but it does not.&amp;nbsp; It gets the green check mark in terms of validation but when I attempt to edit the table accordingly, the "FlagID" value does not auto-increment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if($feature.INSPFLAG == True)&lt;BR /&gt;return nextsequencevalue ("FlagID_Sequence")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any insight you can provide!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2020 19:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70687#M2954</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2020-03-03T19:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70688#M2955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your expression fires on update you'll need to add a bit more logic to this script:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the inspection flag field is empty or set to false you'll return the current feature's FlagID value.&lt;/LI&gt;&lt;LI&gt;If the FlagID is already populated, return the current feature's flag ID value.&lt;/LI&gt;&lt;LI&gt;Then, and only then, should you return the next sequence value.&lt;/LI&gt;&lt;LI&gt;If your "True/False" domain is actually for an integer field you may need to change your check to either compare the feature value against the underlying domain value ($feature.INSPFLAG==1), or dynamically compare against the coded value (DomainName($feature,"INSPFLAG") == "True").&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2020 19:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70688#M2955</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-03-03T19:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70689#M2956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response.&amp;nbsp; &amp;nbsp;&amp;nbsp;My True/False domain is in a text field.&amp;nbsp; I actually have it set to 'insert' because I only want this to&amp;nbsp;fire when a &lt;EM&gt;new&lt;/EM&gt; record is created in my table and when said record has a value of True for the INSPFLAG field.&amp;nbsp;&amp;nbsp;If&amp;nbsp;a new record is added and it doesn't require a flag (default&amp;nbsp;is False), then nothing should happen in the corresponding FlagID field (remains Null).&amp;nbsp; Since I only want this to be an 'insert', I don't believe your points 1 and 2 will be relevant as there currently won't be a FlagID associated with a new record.&amp;nbsp; This is why I thought my initial script made sense.&amp;nbsp; When I input the script in the last line of your response, it again was verified to work but&amp;nbsp;ultimately did not upon my test (no error just no auto-increment occurred in the desired field).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:09:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70689#M2956</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2020-03-03T22:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70690#M2957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, because you have a domain on then your issue is likely issue #4.&amp;nbsp; My script won't work for you data as is because you need to adjust it to match the codes and values in your domain.&lt;/P&gt;&lt;P&gt;As an example, if your true/false domain uses a "t" for true and a "f" for false your comparison would be $feature.INSPFLAG == "t" .&amp;nbsp; You'll just substitute it with whatever string value you have in that field ("true", "TRUE", "T", "Yes", "y" "yes", "1", etc).&lt;/P&gt;&lt;P&gt;If you have any concerns about your code actually being executed I'd also recommend have a default return value of something like -1 so you know that you can confirm your code is running.&amp;nbsp; Any time you change your expression you will need to restart ArcGIS Pro to get the latest code to fire, and if you're editing through feature services you will also need to restart your service (if your service uses a dedicated pool of workers) or the entire ArcGIS Server service (if your service is using shared instances).&amp;nbsp; Because of this I'd recommend you make use of a service with dedicated workers while you're developing your expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2020 22:44:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70690#M2957</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-03-03T22:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70691#M2958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert - I didn't realize that I had to close out of Pro and open it back up!&amp;nbsp; I was making changes to the attribute rule and saving assuming the changes would take affect when I put the table back into the map.&amp;nbsp; Your script is now working as it should.&amp;nbsp; Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been working in our test SDE on this (no service yet).&amp;nbsp; When I do publish this out through Pro, what do you mean by making use of the service with dedicated workers?&amp;nbsp; Or, now that I have it figured out does it not matter when publishing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2020 23:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70691#M2958</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2020-03-03T23:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70692#M2959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris - Excellent!&amp;nbsp; I've been bit by that problem more than a few times.&amp;nbsp; Now that you've got it figured out you should be good when you publish your service.&amp;nbsp; If you do decide to make changes to it in the future just make sure you stop/start the service after making changes any that anyone who was connected to the service restarts their application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2020 00:58:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70692#M2959</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-03-04T00:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70693#M2960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert - I really appreciate your assistance.&amp;nbsp; I was working on ESRI on this matter but it was a slow go so this has saved me time.&amp;nbsp; Your final response to Brian on 1/30/20 was in regards to gaps in the numbering.&amp;nbsp; I've also found this to be the case in my testing when I add a handful of records, delete them, then go back to adding.&amp;nbsp; The auto-increment picks up at the last deleted value instead of restarting based on the current last remaining value.&amp;nbsp; I assume based on your response that nothing can really be done about that?&amp;nbsp; I don't have data validity concerns (you can make the field not-editable when configuring the attribute rule), more so how it looks with strange numbering gaps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:38:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70693#M2960</guid>
      <dc:creator>ChristopherBowering</dc:creator>
      <dc:date>2020-03-04T14:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules: NextSequenceValue in a file database environment.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70694#M2961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris - That is correct.&amp;nbsp; The 'nextsequencevalue' uses a database sequence which uses a simple auto-increment functionality.&amp;nbsp; If you wanted something that could go back and 'fill in gaps' or dynamically find the last used number you would have to write your own code to do that.&amp;nbsp; These rules work great for simple, local datasets but when you start dealing with Enterprise, Versioned datasets the problem becomes much harder to track down because certain numbers may be referenced in unposted versions for days or even years (and Esri doesn't provide an easy API to scan all versions for specific values).&amp;nbsp; This is why they provide and recommend you use a simple sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-nextsequencevalue-in-a-file/m-p/70694#M2961</guid>
      <dc:creator>RobertKrisher</dc:creator>
      <dc:date>2020-03-04T14:46:10Z</dc:date>
    </item>
  </channel>
</rss>

