HOW TO

Configure a unique ID in a feature class that auto-increments by a certain number

Last Published: April 6, 2021

Summary

There is sometimes a business need to configure an ID in a feature class that starts at a certain number and increases by a pre-defined value in the database sequence. For a given project, the customer may not want to use object IDs and increment the same field by one. This article discusses how to define a unique ID and increment sequence in a feature class table.

Procedure

This workflow uses two geoprocessing tools to configure a database sequence that starts at and auto-increments with pre-defined values, and adds an attribute rule into a feature class or table using Arcade expressions to use this sequence in the desired field.
  1. Configure Database Sequence
    1. In ArcGIS Pro, search for the Data Management tool Create Database Sequence.
    2. In the Create Database Sequence geoprocessing tool, select the desired Enterprise Database in the Input Workspace, provide a name for the Sequence Name, a number for the Sequence Start ID, and the Sequence Increment Value
  1. Configure Attribute Rule
    1. Search for the Data Management tool Add Attribute Rule.
    2. In the Add Attribute Rule tool, provide a Name and Description for the rule
    3. Select Calculation for Type, the desired Feature Class or Table for Input Table, the Field for the sequence
    4. Uncheck Is Editable. This way, the sequence values are auto-generated and field workers cannot modify them since the values are coming from the database
    5. For Triggering Events, select Insert
    6. In the Script Expression, select the desired Field(s) and type: return "" + NextSequenceValue ('database_sequence_name')
We are now able to add features in the feature class or table that auto-populates the defined unique ID and increments by the value defined in the sequence.
Note: 
If this feature class is published as a service and there are issues writing to this field in Portal for ArcGIS, ensure that the user who created the database sequence is the same as the owner of the table used in the attribute rule, and that this user has read and write privileges in the database.
 
 

Article ID: 000024830

Software:
  • ArcGIS Pro 2 7 x
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options