In QGIS I have a shapefile containing about 2000 features where I added a unique ID using the $id expression . I want to continue adding features to the same table, using the attribute feature pop-up after finishing the geometry creation.

My question is: is there an expression or function that auto-increment on the id numbers already in the id column? E.g. if you have id's from 1-2000, then QGIS automatically suggesting id number 2001 for the next feature added?

enter image description here

1 Answer 1


There is AutoFields plugin which does exactly what you have described.

After selecting the layer, choose your id field as the target Existing Field then give $id expression into the Custom Expression.

Having said that, I would recommend Update existing field in the Field Calculator.

enter image description here

It means you will update id field after adding features, but it would be easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.