How to automatically create ID for existing feature classes?

632
3
10-19-2023 07:25 AM
Labels (3)
MingLangLi
New Contributor

Hello,

Just wondering that could I automatically to create IDs for the existing feature classes?

 

For example, I have pipes in the database already, the PIPEID fields are all Null, but I do not want to given them the IDs one by one.

MingLangLi_0-1697725468554.png

 

How could I do something to create the IDs automatically.

Your help is appreciated. 

Thank you.

Ming

0 Kudos
3 Replies
leahmaps
Occasional Contributor II

Do you have a certain way you want to ID them? Or just 1,2,3, etc?

0 Kudos
RobertKrisher
Esri Regular Contributor

One way to accomplish this would be to write an attribute rule that would run every time a feature is created to give it a unique ID using a sequence. Then what you can do is take that arcade expression and use it in the calculate field tool on this layer (just make sure you set the language to Arcade).

leahmaps
Occasional Contributor II

https://youtu.be/T3v5Ff0UDBY?si=dDHdeone6qzHWw48 Here is a YouTube Video explaining how to assign a simple number to the list. 

In words, left click on the field header and choose calculate field. The expression type must be Python 3. 

In the "Helpers" group type (or scroll to) S and click Sequential Number, then apply. This will automatically give numbers to your items in order.