Forum Discussion

Eric Adler's avatar
Eric Adler
Steel Contributor
Aug 10, 2016
Solved

Getting Link to a Document with Modern Document Libraries

With the new "modern" document libraries UI it seems almost impossible to get a "normal" link. Meaning a link that is does not contain "guesttoken" and a GUID. But an old school URL with a readable path.

Is the guidance to generate a link using "Get Link" for all link needs? Doesn't seem like there is any other options.

 

One challenge is that at the time of link generation one needs to determine if the link is for editing or viewing. Based on document lifecycle this may change. For example, I want to send someone a link to a document in an email and to start they are just supposed to view it. Later that person needs to edit the document. Do I need to then send them the Edit link?

 

I am assuming too that the generated link is to the current location of the document and is not releated to the Document ID feature. So if a document changes location a new link would need to be generated.

 

It seems this functionality was put in place to facilitate the external sharing features? Maybe? It is admittedly, tripping me and our SharePoint team a bit. We like readable URLS. :)

  • There is a way to disable the 'Edit' and 'View' link feature. The only link that appears then is the restricted link.

    Go to site settings -> Site permissions -> Access Request Settings -> Disable Allow members to share the site and individual files and folders.

    This would prevent the breaking of permission.

  • Anoop T's avatar
    Anoop T
    Copper Contributor

    I have developed an SPFx extension to solve this problem. The extension can be easily deployed. Please find more details on this in my blog post. Hope this helps.

     

  • Another way to get the link is through the version history. Copy the link from the "View Document" of the latest version.
  • It seems to be quite a hassle to send a link to a document. One way I found that is slightly easier is to open the document that you want to share. Then copy the Url from your browser:

     

    https://mytenant.sharepoint.com/sites/test/_layouts/15/WopiFrame.aspx?sourcedoc=%7B47F1053D-7C09-4F11-BA37-82BA582DA04D%7D&file=Document.docx&action=default&IsList=1&ListId=%7B28BF7AFE-D452-4991-A19D-6F53B00C8D6A%7D&ListItemId=3

     

    You will end up with a bit of an uggly Url but you could display it like this:

    My document

     

    Another way is to Sync the Library first. Then within your Onedrive for Business find the file and right click -> OneDrive for Business -> Copy Link. this now results is a decent url and a quick way to share my document:

     

    https://mytenant.sharepoint.com/sites/test/Shared%20Documents/Document.docx?web=1

     

  • Richard Duffy's avatar
    Richard Duffy
    Copper Contributor

    This is very annoying - i need to be able to insert links in emails and in other documents. You used to be able to get the URL to an item within a couple of clicks.

    • Eric Adler's avatar
      Eric Adler
      Steel Contributor

      two ways i have found to get a real url (one that you can read the path)

       

      Get A LInk Method

      1. Click Get A Link

      2. From Drop select "Restricted Link"

      3 Click in box and copy

       

      From Office

      1. Open document in Office Client Program

      2. Click File

      3. Click on path and select "Copy Path"

      Caveat is that the url will have the query sting web=1 which i like to remove.

       

      There was an annoucement in the admin messages on August 15th saying that the "Get A Link" feature will soon default to the Restricted link which will save a click and the creation of unneeded guestaccess links.

       

      Here is the article on the update

      https://support.office.com/en-us/article/Change-the-default-link-type-when-users-get-links-for-sharing-81b763af-f301-4226-8842-8d13bd07face?ui=en-US&rs=en-US&ad=US

      • Bernd Verhofstadt's avatar
        Bernd Verhofstadt
        Iron Contributor

        There is a way to disable the 'Edit' and 'View' link feature. The only link that appears then is the restricted link.

        Go to site settings -> Site permissions -> Access Request Settings -> Disable Allow members to share the site and individual files and folders.

        This would prevent the breaking of permission.

  • Ivan54's avatar
    Ivan54
    Bronze Contributor

    I'd like to know how to get a default internal link to the file, but with the Durable ID (successor to the Document ID Service)? In the old DocLib UI you could click the 3 dots and in the popup window above you would get the link plus ?d=GUID for a durable link, but without all the guest token blabla. 

    I haven't found a way to get this URL+?d=GUID link in the new UI. Or are we supposed to use the "get link" feature and use the internal restrictions?

  • Eric Adler's avatar
    Eric Adler
    Steel Contributor

    I have found that if you are in the modern document library you have the opportunity to use the "Restricted Link" to get the standard URL via the "Get a Link" menu.

     

    Both Edit & View links will create the GUID based links that can be found under People & Groups in Site Settings > Users and Permissions.

     

     

    • Shai Petel's avatar
      Shai Petel
      Copper Contributor
      Well... the "Restricted Link" was replaced by the "People with existing access" option - and guess what? It doesn't give you a plain old link anymore...

      Ugh!! This is so annoying!
  • Angus Tong's avatar
    Angus Tong
    Copper Contributor
    I am interested in knowing the reasoning behind the changes too. More so for my own knowledge at why the change. :)
    • Eric Adler's avatar
      Eric Adler
      Steel Contributor

      It is great to have the ability to default this to the restricted link now!!!

       

      Thank you MSFT!!!

Resources