Skip to content

Counter Fields

Counter fields generate sequential, human-readable identifiers with a customizable prefix.

POST /api/apps/{app}/tables/invoices/fields
{
"name": "number",
"type": "counter",
"config": {
"prefix": "INV"
}
}

This produces values like INV-000001, INV-000002, INV-000003.

  • Guaranteed unique across all records
  • Padding starts at 6 digits and expands automatically as the table grows
  • Values are assigned on record creation and cannot be changed
  • Searchable via the global search endpoint – search for INV-42 to find INV-000042
OptionDescription
prefixUppercase A-Z, max 10 characters
suffixAppended after the number (max 10 characters)
pad_lengthFixed zero-padding width instead of the default dynamic padding
startFirst value in the sequence
stepIncrement between values
  • One counter per table – a table can have at most one counter field
  • The field is automatically named number regardless of the name you provide
  • Prefix must be uppercase A-Z, max 10 characters

There is no counter shared across several tables. Virtual tables once offered one; they were removed, and union views — which replaced the use case — deliberately have no union-level counter, because a counter that spans tables gives one record two identities.

Give each table its own counter with its own prefix. Reading them together through a union view then shows TASK-000001 beside INC-000004, where the prefix tells you which member a row came from without consulting the discriminator column.