Forum Discussion

iamsarah's avatar
iamsarah
Brass Contributor
Nov 10, 2022
Solved

Add Document Link in Properties Form (configure layout)

Hi,

 

I have a document library and want to customize the Properties from using "Configure Layout", I need to have the link to the document either on the header or the body but can't figure it out how. basically, I want users to be able to open the document from Properties window. Tried FileLeafRef and Name but didn't work.

 

Does anyone know how to achieve this without going through adding additional columns, workflow?

 

Thanks

 

 

  • iamsarah I tried this on our SharePoint site and found the same behavior. Ideally you should be able to get the file name using [$FileLeafRef] but it is not working.

     

    Try raising support ticket with Microsoft directly: Get Online support 

     

    Additional Info: If you want to download the file on click from properties pane and document ID feature is enabled for this library, you can use JSON like: 

     

    {
      "elmType": "a",
      "txtContent": "Link to Document",
      "attributes": {
        "href": "[$_dlc_DocIdUrl]",
        "target": "_blank"
      }
    }

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

  • iamsarah I tried this on our SharePoint site and found the same behavior. Ideally you should be able to get the file name using [$FileLeafRef] but it is not working.

     

    Try raising support ticket with Microsoft directly: Get Online support 

     

    Additional Info: If you want to download the file on click from properties pane and document ID feature is enabled for this library, you can use JSON like: 

     

    {
      "elmType": "a",
      "txtContent": "Link to Document",
      "attributes": {
        "href": "[$_dlc_DocIdUrl]",
        "target": "_blank"
      }
    }

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • iamsarah's avatar
      iamsarah
      Brass Contributor

      ganeshsanap 

       

      Thanks ganeshsanap 
      document id is enabled. I tried your code but the url looks like this which the value of document id is repeated:

      /DocIdRedir.aspx?ID=MTS-1600998660-63,%20MTS-1600998660-63

      how can I grab everything before comma?

       

       

      • iamsarah I am able to download the file from properties pane by using exact JSON given in my above reply. Is it working for you?

         

        If you want substring (part of string), you can check the supported operators in JSON formatting at: JSON formatting - operators 


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources