How to Add Auto Increment Field in QGIS

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:

  1. Double-click the Add auto incremental field from the Vector Table toolbox.
  2. Select the layer from the Input layer
  3. Specify the field name. The default value is AUTO but you can change it to anything you like
  4. You can specify the starting values. If you did not specify, it will start from 0.
  5. Click Run to start the process

Result

As you can see, now I have a field called Incremental_Field which contains numbers starting from 1000.

Conclusion

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.