Auto Number
The Auto Number field gives each record in your table a unique, sequential number. Numbers start at 1 and increase by 1 for each new record. Use this field for simple sequential identifiers that people can read, for example ticket numbers, invoice numbers or order IDs. You do not need the internal primary key for this.
Create an Auto Number field
- Click the
+icon next to the last field in your table. - Enter a name for the field (optional).
- Select Auto Number from the list of field types.
- Click Save Field. NocoDB adds the field to your table.
Refer to the general guidelines on creating a field.
Cell display
The Auto Number field shows as a read-only numeric cell. NocoDB generates the values. You cannot edit the values or paste into the cell.
Key behaviours
Read-only
NocoDB generates Auto Number values. You cannot edit, paste or override them. If you try to update an Auto Number value through the UI or the API, NocoDB ignores the update and shows no error. The original value stays.
Sequential numbering
NocoDB assigns values in sequence. The first value is 1, and each new record gets the next value (plus 1). A PostgreSQL sequence makes sure that each value is unique. When you delete a record, NocoDB does not use its number again. The sequence continues from the highest value that it assigned.
Backfill on creation
When you add an Auto Number field to a table that has records, NocoDB fills all existing records with sequential numbers (1, 2, 3, ...). The numbers follow the row order of the current view. If the view has a sort, the sorted order sets which record gets which number. New records after the backfill continue the sequence from the next available number.
Type conversion
You can convert an existing Number or Single line text field to an Auto Number field. The conversion replaces the original values with sequential numbers (1, 2, 3, ...). The numbers follow the row order of the current view.
Not available in forms
The system generates Auto Number values, so Auto Number fields do not show in form views. When a form submission creates a new record, NocoDB assigns the value.
Can be set as display value
You can set an Auto Number field as the display value of the table. Each record always has a value, so the field is a stable label for the record that people can read.
Filtering Auto Number fields
Auto Number fields support these numeric filter operations.
| Filter operation | Description |
|---|---|
| is equal | Matches the exact number |
| is not equal | Excludes the exact number |
| is greater than | Matches records greater than the value |
| is less than | Matches records less than the value |
| is greater or equal | Matches records greater than or equal to the value |
| is less or equal | Matches records less than or equal to the value |
| is null | Matches records with no value |
| is not null | Matches records that have a value |
Sorting Auto Number fields
You can sort Auto Number fields in ascending or descending order. The values are numeric and sequential. Thus a sort on this field puts records in the order that they were created.
Limitations
- PostgreSQL only: Auto Number fields need a PostgreSQL database. They are not available on MySQL, SQLite or other database backends.
- Not configurable: You cannot change the start number, increment value, prefix or suffix. Values always start at 1 and increase by 1.
- No manual editing: You cannot set or change values after creation.
- No copy-paste: You cannot paste values into an Auto Number field.
- For external database connections, NocoDB supports Auto Number fields only on PostgreSQL databases.
Availability
- Auto Number is available on all NocoDB Cloud plans and licensed self-hosted deployments (Business plan and above).
Last updated on