2

I have a library in which I store .doc files. I want to show URL of document in another column (say. DocumentURL).

The library should show URL of the document in DocumentURL column when new document is added to library

Please suggest ootb procedure. Thanks

0
3

You could do that with an workflow (below with an SharePoint 2010 WF) and "Set Field in Current Item". So the field would be "DocumentURL" and the value ist over "Workflow Context" available.

The column could be an "Hyperlink or Picture" column.

  1. Workflow Action

    enter image description here

  2. Properties of the action

    enter image description here

  3. If you want to start the workflow after uploading make sure the start options are set

    enter image description here

  4. The output should be similar to this

    enter image description here

If you click on that link, it will open up the .pdf file and you can also copy that link and send it via e-mail.

5
  • but on clicking this URL I get display form of the record. I want a visible link to open the document to which I copy and paste (i.e the link) and send to someone via email... – Lucifer Aug 9 '16 at 6:41
  • updated answer. For me it is working, maybe you can update your question with an screenshot? – Patrick Aug 9 '16 at 8:11
  • Any news @Lucifer? Does my answer work for you? – Patrick Aug 17 '16 at 6:19
  • thanks Patrick. [Current Item:Encoded Item URL] worked for me. – Lucifer Aug 23 '16 at 6:31
  • allright, you may consider to rate my answer as "the answer" so others could find a solution to that problem. – Patrick Aug 23 '16 at 10:21
0

if you do not want to go workflow you can refer the below link for get all metadata of doc's

0

Please try the CSR below:

function init() {
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
        Templates: {
            Fields: {
                "DocumentURL": {
                    View: function(ctx) {
                        return window.location.protocol + "//" + window.location.host + ctx.CurrentItem["FileRef"];
                    },
                }
            },
        },
        ListTemplateType: 101
    });
}
RegisterModuleInit(SPClientTemplates.Utility.ReplaceUrlTokens("~siteCollection/Style Library/DocURL.js"), init);
init();

You might have to change the column name ('DocumentURL') to the internal name of the corresponding column in your list.

You might have to change the URL in the RegisterModuleInit-function depending on where you upload the script and how you call the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.