SharePoint Document IDs, Auto-Numbering and Unique IDs: Which ID to Use, and Why Calculated [ID] Numbers Break

SharePoint has three IDs: the item ID (a number, unique per list), the unique ID (a GUID, unique everywhere), and the Document ID (a readable code from the Document ID service, unique per site collection, with a permanent link). Document IDs are assigned by a background job, so they can take a while to appear. Don't build auto-numbers from [ID] in a calculated column: it shows 0 once items are recalculated. Use a Document ID, a flow, or a number column filled on create.

Published:

Last updated: 2026-10-29

The three IDs on every file

IDExampleUnique withinSurvives a move?Use it for
Item ID (ID)9One list; never reusedNo, a new list gives a new IDLookups, list URLs (DispForm.aspx?ID=9)
Unique ID (UniqueId)a GUIDEverywhereWithin a site collectionCode, APIs, sharing links
Document ID (_dlc_DocId)42HP62VHTTJC-80273064-9The site collectionWithin a site collectionPeople: references on drawings, contracts, emails; permanent links

The Document ID is the only one designed for people. Its link, /_layouts/15/DocIdRedir.aspx?ID=42HP62VHTTJC-80273064-9, finds the file wherever it moves within the site collection, which path links don't (see what breaks when a URL changes).

Turning on Document IDs

  1. Site settings, Site collection features, activate Document ID Service. You need to be a site collection admin.
  2. Site settings, Document ID settings: set the prefix (4 to 12 characters) and keep "Assign Document IDs" ticked.
Site Collection Features page with Document ID Service shown as Active
Document ID Service is a site collection feature, so it's on or off for the whole site collection.
Document ID Settings: Configuration of the Document ID feature is scheduled to be completed by an automated process, Assign Document IDs ticked, prefix 42HP62VHTTJC
"Scheduled to be completed by an automated process": existing files get IDs later, not now.

Then the file shows a read-only Document ID property with the link:

File properties for RMC-P2-DD-A-201 Level 2 Floor Plan Outpatient Clinics.docx with Document ID (Read only) 42HP62VHTTJC-80273064-9
The Document ID is read-only. The last number is the item ID.

Why a Document ID is missing

When we checked the library after turning the service on, two of the three files had IDs; the third, and every folder, had none yet. A library created afterwards didn't even have the Document ID column at first ("The field or property '_dlc_DocId' does not exist"). Reasons, in order of likelihood:

  • The background job hasn't run yet. Files that existed before activation are processed by a timer job. In SharePoint Online that can take hours to a day on a large site collection.
  • It's a folder. Folders don't get Document IDs.
  • The library was created after activation and the column hasn't been provisioned yet. It arrives with the same background job.
  • The file was copied in. A copy is a new document with a new ID; the source's ID is not kept (see copying between sites).

New uploads get an ID as they're added. For existing files, waiting for the job is the fix; editing a file usually assigns its ID sooner.

Don't auto-number with a calculated [ID] column

The obvious way to get "T-00001" style numbers is a calculated column: ="T-"&TEXT([ID],"00000"). We added it to our 5,501 item task list. Right after adding it, item 25 showed T-00025. Once SharePoint recalculated the items, every item showed T-00000:

Grid view of Project Tasks with Task Number showing T-00000 on every row next to working Due Month, Days Planned and Task Key calculated columns
Task Number is T-00000 on every row. The other calculated columns are fine.

[ID] doesn't exist yet when a new item's formula is first calculated, and it isn't reliable in recalculations either. Use one of these instead:

  • Document ID for files, if a site-collection-wide code is enough.
  • A number or text column filled by Power Automate on create: "When an item is created", then "Update item" with concat('T-', formatNumber(triggerOutputs()?['body/ID'], '00000')).
  • The ID column itself in views, with JSON formatting to display it with a prefix.

Option 1: Check Document IDs across sites with PowerShell

This PnP PowerShell script reports, for each site, whether the Document ID service is active and how many files in each library don't have an ID yet. It only activates the feature where it's off when you set $WhatIf = $false. It needs PnP PowerShell 2.x, site collection admin rights and your own Entra ID app registration.

$ClientId  = "<your-app-id>"
$Sites     = Import-Csv .\sites.csv                       # one column: Url
$DocIdFeat = "b50e3104-6812-424f-a011-cc90e6327318"       # Document ID Service, site collection scope
$WhatIf    = $true

foreach ($s in $Sites) {
    Connect-PnPOnline -Url $s.Url -Interactive -ClientId $ClientId
    $on = [bool](Get-PnPFeature -Scope Site -Identity $DocIdFeat)
    "{0}: Document ID service {1}" -f $s.Url, $(if ($on) { "active" } else { "OFF" })
    if (-not $on) {
        if (-not $WhatIf) { Enable-PnPFeature -Scope Site -Identity $DocIdFeat }
        continue
    }
    foreach ($lib in Get-PnPList | Where-Object { $_.BaseTemplate -eq 101 -and -not $_.Hidden }) {
        if (-not (Get-PnPField -List $lib -Identity "_dlc_DocId" -ErrorAction SilentlyContinue)) {
            "  {0}: no Document ID column yet" -f $lib.Title; continue
        }
        $files   = Get-PnPListItem -List $lib -PageSize 2000 -Fields "_dlc_DocId", "FSObjType" | Where-Object { $_["FSObjType"] -eq 0 }
        $missing = @($files | Where-Object { -not $_["_dlc_DocId"] }).Count
        "  {0}: {1} files, {2} without an ID" -f $lib.Title, $files.Count, $missing
    }
}

Option 2: Check the feature on every site with SharePoint Essentials Toolkit

The toolkit's Get inventory of sites & lists task includes a Features report: every feature active on every site and site collection you pick. Search it for "DocId" to see where the Document ID service is on:

SharePoint Essentials Toolkit Features report filtered to Doc: DocId feature at Site scope with feature ID b50e3104 on Architecture-Knowledge-Base
DocId at Site scope means the service is on for that site collection.

When you copy libraries between sites with the toolkit's Copy lists task, item IDs are kept, so DispForm.aspx?ID= links and lookups that store IDs still point at the right items on the target.

Community Edition is free on up to 20 sites per Microsoft 365 tenant.

Frequently asked questions

Why is the SharePoint Document ID not showing on my files?

Files that existed before you turned on the service are processed by a background job, which can take hours. Folders never get one. Editing or uploading a file assigns an ID straight away.

Does the SharePoint Document ID change when a file is moved?

Not within the same site collection, and the DocIdRedir.aspx link keeps finding it. A copy, or a move to another site collection, gets a new ID.

Why does my SharePoint calculated column using [ID] show 0?

The ID doesn't exist when a new item's formula is first calculated, and it isn't reliable in recalculations. In our test every item showed T-00000. Use a flow or a Document ID instead.

Can I change the SharePoint Document ID prefix?

Yes, in Document ID settings. Tick "Reset all Document IDs in this Site Collection" to apply it to existing files; that changes every ID, so old references stop matching.

What is the difference between ID and UniqueId in SharePoint?

ID is a number unique within one list. UniqueId is a GUID unique everywhere. Neither is meant for people; the Document ID is.

Check SharePoint features on every site, free

SharePoint Essentials Toolkit Community Edition is free. Inventory sites, lists and active features like the Document ID service, and copy libraries with item IDs kept, on up to 20 sites per Microsoft 365 tenant. Get your free Community Edition license key.

About the author. The Cognillo SharePoint Team builds and supports SharePoint Essentials Toolkit and has worked with SharePoint administrators on permissions audits, migrations and cleanup projects since 2012.