What is Document ID Service in SharePoint Online?
The Document ID service in SharePoint Online automatically generates and assigns a unique number to each document which can be used to locate that document anywhere within the site collection. Once the uploaded document gets a unique number, a URL is also formed by this unique ID. So, we can use it to quickly find a document within the SharePoint Online site collection even when the document is moved to another location within the same site collection, as the document ID and URL properties of the document don’t change.
How to Configure Document ID Feature in SharePoint Online?
The Document ID Service is a feature that needs to be activated in SharePoint to provide unique IDs to documents in a site collection. To configure the Document ID Service, We have to activate the document ID feature. Here is how to activate document id in SharePoint Online:
- Navigate to the site collection Root >> Click on the “Settings” icon >> Site Information >> View all site settings.
- On the Site Settings page, under the Site Collection Administration section, click on “Site Collection Features”.
- Locate and click on the “Activate” button for “Document ID Service”. Wait for a button labeled Active appears next to it.
- Now, go to the site settings page again, click on the “Document ID Settings” link from the Site Collection Administration section.
- On the Document ID Settings page, To enable auto-generated IDs, select the “Assign Document IDs” check-box. Set the characters to use as a prefix for document IDs and the search scope for locating documents by ID. The prefix should be between 4 and 12 characters with no special character.
- To apply the new prefix to existing documents in the site collection, select the “Reset all Document IDs in this site collection, to begin with, these characters” check-box.
- Click on the OK button to save the Document ID settings. Now, any document created or uploaded to this site collection will be assigned with a unique ID that are prefixed with text “Mark-“
Display the “Document ID” column on a Document Library
SharePoint Online stores the ID as part of a document’s metadata. You can also add the “Document ID” column to the document library’s view. Here is how: Once the “Document ID service” feature is activated:
- Navigate to any document library >> Click on Views drop-down menu >> choose “Edit Current View”
- Check the box next to the “Document ID” column, and set the order, and click OK.
Now, You’ll see the “Document ID” column appears with its assigned unique ID in your library!
SharePoint Online: Get Document ID
The document ID is viewable on the document properties page, along with any other standard document properties. Just navigate to the document library, Right-click on any document, choose “Properties”, and you’ll see the document ID value in the properties pane!
URL to Get Document By Its Document ID
Also, the document with the document ID assigned can be accessed regardless of its location with URL: https://tenant.sharepoint.com/_layouts/DocIDRedir.aspx?ID=<DocumentID>, e.g., https://crescent.sharepoint.com/sites/marketing/2018/_layouts/DocIDRedir.aspx?ID=MARK-1265375246-1, which takes us to the document directly! You can obtain this URL by Right-clicking on the “Document ID” value in the details pane, and choose “Copy link location” from the browser’s context menu!
Last but not least: SharePoint Online maps the document IDs with a managed property called “DlcDocId”. So you can use Search to find documents by its document ID as DlcDocId: <DocumentID>. E.g., “DlcDocId:MARK-1265375246-1”
To activate document ID service in SharePoint Online using PowerShell, use: SharePoint Online: Enable Document ID Service using PowerShell