How to Build Notion Database With Auto-Numbering ID Property
🔍 WiseChecker

How to Build Notion Database With Auto-Numbering ID Property

Notion databases do not include a built-in auto-numbering field like traditional spreadsheet applications. Many users need a unique identifier for each row to track inventory, invoices, tasks, or client records. This article explains how to create a reliable auto-incrementing ID property using Notion formulas and database settings. You will learn two methods: one using a manual rollup and another using a formula that references a unique timestamp.

Key Takeaways: Creating an Auto-Numbering ID in Notion

  • Formula property with formatDate and timestamp: Generates a unique ID based on the creation date and time, ensuring no duplicates.
  • Manual rollup with a helper database: Creates a sequential number by referencing a count of rows in a separate database.
  • Name property as ID: Uses a formula to automatically populate the database name field with the generated ID for display in views.

ADVERTISEMENT

Understanding Auto-Numbering in Notion Databases

Notion does not offer a native auto-number property. When you add a new row, there is no automatic incrementing number like in Excel or Airtable. The workaround involves using Notion’s formula capabilities combined with the creation timestamp of each page. Every page in a Notion database has a hidden created_time property that records the exact date and time when the page was added. By formatting this timestamp into a numeric string, you can produce a unique ID for each row. This method works reliably as long as no two pages are created in the same millisecond, which is practically impossible for manual entry. The ID can be displayed directly in the database view or used to populate the page title for easy reference.

Steps to Build an Auto-Numbering ID Property

  1. Open your Notion database
    Navigate to the database where you want to add the auto-numbering ID. This can be a table, board, or list view.
  2. Add a Formula property
    Click the + button in the last column header. Select Formula from the property type list. Name it ID or Auto Number.
  3. Enter the formula
    Click into the formula field and paste the following code:
    formatDate(prop("Created Time"), "YYMMDDHHmmss")
    This extracts the creation date and time and formats it as a 12-digit string: year, month, day, hour, minute, second.
  4. Test the formula
    Add a new page to the database. The formula property will display a unique number based on the exact creation moment. Each new page gets a higher number.
  5. Optional: Use the ID as the page title
    If you want the ID to appear in the database name column, add a second formula property named Title with the formula:
    "ID-" + formatDate(prop("Created Time"), "YYMMDDHHmmss")
    Then rename the original Name property to Notes or Description and hide it. The Title formula will now act as the primary identifier.

ADVERTISEMENT

Alternative Method: Sequential Numbering Using a Helper Database

If you need a true sequential number (1, 2, 3…) instead of a timestamp-based ID, you can use a separate database to count entries. This method requires a manual step but gives you sequential numbering.

  1. Create a helper database
    Create a new database called ID Counter with a single row. Add a number property called Count set to 0.
  2. Add a Rollup property to your main database
    In your main database, add a Rollup property. Configure it to relate to the ID Counter database. Set the rollup calculation to Count All.
  3. Create a formula for the ID
    Add a formula property with the formula:
    prop("Rollup Name") + 1
    Replace Rollup Name with the actual name of your rollup property.
  4. Update the counter manually
    Each time you add a new page, manually increment the Count property in the ID Counter database by 1. The rollup will update automatically, and the formula will show the next number.

Common Issues and Limitations

Formula shows blank or error

If the formula field shows an error, check that the property name Created Time matches exactly. Notion property names are case-sensitive. If you renamed the Created Time property, use the exact name you gave it.

Duplicate IDs when adding multiple pages at once

When you paste multiple rows at the same time, they may share the same creation timestamp and produce duplicate IDs. To avoid this, add a random element to the formula: formatDate(prop("Created Time"), "YYMMDDHHmmss") + format(unparse(id()), ""). The id() function returns a unique internal page ID.

Sequential method requires manual updates

The helper database method is not fully automatic. You must remember to increment the counter each time you add a row. For most users, the timestamp-based formula is more practical.

Timestamp-Based ID vs Sequential Numbering: Comparison

Feature Timestamp-Based ID Sequential Numbering (Helper DB)
Automation Fully automatic Requires manual counter update
Uniqueness Guaranteed unique per millisecond Guaranteed sequential
Readability Long numeric string (12+ digits) Short integer (1, 2, 3)
Setup complexity One formula property Three properties + second database
Best for Invoices, order numbers, client IDs Task lists, simple row counts

Choose the timestamp method for most business use cases. It requires no maintenance and always produces a unique ID.

You can now add an auto-numbering ID to any Notion database using a formula based on the creation timestamp. This ID works as a reliable unique identifier for records, invoices, or any data that requires a reference number. For more advanced needs, explore Notion’s formatDate() function to customize the ID format, such as adding a prefix or using a different date order. To make the ID clickable, consider using a formula that generates a link to the page itself.

ADVERTISEMENT