Welcome to QGIS Tutorial. Today, we are going to show you how to add an auto-increment field in QGIS table. There is a special tool called Auto Incremental Field. This algorithm adds a new integer field to a vector layer, with a sequential value for each feature. This is a very useful tool when we need to give a unique value to each row on a table.
For example, I have a shapefile containing points as follow
To create an auto incremental field, follow these steps:
- Double-click the Add auto incremental field from the Vector Table toolbox.
- Select the layer from the Input layer
- Specify the field name. The default value is AUTO but you can change it to anything you like
- You can specify the starting values. If you did not specify, it will start from 0.
- Click Run to start the process
As you can see, now I have a field called Incremental_Field which contains numbers starting from 1000.
Auto Incremental Fields tool in QGIS is a useful tool you need to aware of. In some cases, you will need this tool. Thanks for reading this article, I hope you enjoy it and see you on the next QGIS Tutorial. Cheers.