I'm looking for a way to auto-increment a field with a unique id every time I create a new feature on QGIS. Ideally, this new feature_name should appear in the new feature form that pops up when creating the new feature.

So from an empty table, it should look like this :


QF00001 QF00002 QF00003 QF00004 ...

How do I select text/string format (it's a gpkg file). I can chose integer,integer64,double,string,json

  • 2
    Something to think about: what do you want to happen when an existing feature is deleted some day in the future? Is it ok to lose that unique id, or will you always require an uninterrupted numerical sequence? If the latter, you'll probably want the "downstream" sequence to ratchet up.
    – Stu Smith
    Sep 21, 2021 at 17:18


Browse other questions tagged or ask your own question.