Is it possible to set the initial auto-increment value of a field?
With thanks, Theodore
Is it possible to set the initial auto-increment value of a field?
With thanks, Theodore
Hi @sebastian.scholl and thank you,
Following setting up an auto-increment field, is it then possible to set its initial value i.e. start the increment at a specific number instead of starting the count at zero.
Using the Number Field with Auto Increment doesn’t allow you to specify a starting point. However, if you wanted to create a calculated field (stored or virtual) that uses the Auto-Increment field in a calculation, you could do that.
For example:
Text Field -> Calculated -> Virtual
CONCAT(autoIncrementFieldName + 10, "-some-string")
.
Then your first record’s field value would be would be:
11-some-string
UPDATE: I WAS WRONG
You can’t do this…
However, there is a hack…
Let’s say you wanted to start incrementing records from 19. When you create your workspace, go ahead and create 20 dummy records in your table with the auto-increment field. Then destroy all those records. After that, you’ll have effectively configured your database to start incrementing numbers starting at 20.
You can’t do this…
However, there is a hack…
Let’s say you wanted to start incrementing records from 19. When you create your workspace, go ahead and create 20 dummy records in your table with the auto-increment field. Then destroy all those records. After that, you’ll have effectively configured your database to start incrementing numbers starting at 20.