SharePoint Online – Permanent links to documents
Sometimes I get the question how you can reference a document stored on SharePoint from within a Word document, or from within CRM, without risking to end up with a broken link, even after the document is moved or renamed.
You can achieve this by activating the Document ID Service feature, which is a site collection feature. This feature already exists for a long time in SharePoint, but as this question comes up regularly, I decided to write a post about it.
This feature assigns a unique id to each document. If you now go to a document in a document library, and you click the Copy link button,
you get a URL similar to this:
https://boske.sharepoint.com/sites/projects/ABC/_layouts/15/DocIdRedir.aspx?ID=PROJECTDOC-476-47&e=586b214f0a64467cbd65c8b26c469dc1
If you rename a document, or move it, this URL still works. Also URLs as follows will work, as long as the URL is a valid URL to an existing SharePoint site, and as long as this SharePoint site has the Document ID service feature activated:
https://boske.sharepoint.com/sites/accounts/_layouts/15/DocIdRedir.aspx?ID=PROJECTDOC-476-47&e=586b214f0a64467cbd65c8b26c469dc1 https://boske.sharepoint.com/teams/group123/_layouts/15/DocIdRedir.aspx?ID=PROJECTDOC-476-47
If you look at the URL of the opened document, you will see something like this:
https://boske.sharepoint.com/:w:/r/sites/projects/ABC/_layouts/15/WopiFrame.aspx?sourcedoc={28027ac9-1ca9-4f46-98c3-ea47c9983bbe}&action=default
You can even get to the document using your OneDrive URL, (but again, the Document ID service feature needs to be activated on your OneDrive, which is a site collection):
https://boske-my.sharepoint.com/personal/kboske_com/_layouts/15/DocIdRedir.aspx?ID=PROJECTDOC-476-47
If you delete the site or the site collection afterwards, the URL will not work anymore, even if you moved the document to another location. Therefore I advise my users to use the URL of the root SharePoint site:
https://boske.sharepoint.com/_layouts/15/DocIdRedir.aspx?ID=PROJECTDOC-476-47
As long as the document exists in one of your SharePoint Online sites, you will be able to reference it this way.
For the record, in SharePoint 2016 we have durable links. You can find a good blog post on durable links in SharePoint 2016 here. As far as I know, this is different from SharePoint Online. If you know of a different way for SPO, please leave a comment.
No comments yet.
Leave a Reply