Forum Discussion
iamsarah
Nov 10, 2022Brass Contributor
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 ...
- Nov 10, 2022
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
Nov 10, 2022Brass Contributor
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?
ganeshsanap
Nov 11, 2022MVP
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.