Update the Existing file name and file url


  • Hi,

    I am trying to remove the space and replace with underscore whenever user upload the document.

    Here how to update the Document name and url using SharePoint Designer Workflow or is there any way we can achieve the same.

    Thanks in advance..

    Friday, March 10, 2017 1:13 PM

All replies

  • Arthi,

    There are a few solutions that will work for you but each solution varies in the way you will need to implement it.

    1. Workflow that will rename a document when it is uploaded.

    2. Use JavaScript to hook into the file uploads and rename the file directly after upload. 

    3. Use server-side event receivers to rename the file.

    The method that you should use depends upon which version of SharePoint you are using and the limitations/benefits you are looking for.

    If you simply want to rename every file that is uploaded, I recommend that you use a workflow. How to do this:

    Here is an example workflow:

    Set Variable: currentName to [%Current Item:Name%]
    Replace " " with "_" in Variable: currentName (Output to Variable: newName)
    Set Name to Variable: newName

    • Edited by s.walker1522 Friday, March 10, 2017 1:33 PM Misspelling
    Friday, March 10, 2017 1:31 PM
  • Hi,

    Thanks for your update.

    I can understand the replace action which you have mentioned. But I don't know how to update the uploaded file name and url.

    .In update item(designer workflow) I can only find three options like Content Type Id, Path and Name ,Title. Here which field I need to choose for updating the document name and its url

    Friday, March 10, 2017 1:40 PM