In Part 1 of this post I discussed the possible options to obtain a document URL for a document in the document library. With this post I will explain how you can achieve this with a simple workflow.

In your document library create a column “Encoded URL” (Single line of text). It will be used to store URL later on. In your document library versioning settings you must set option to require checking out items. This is very important step. The workflow we are going to create will be fired every time document is modified. Since workflow will modify item, if we do not require checking out, workflow might end up in an infinite loop. Without checking out workflow might result in very confusing errors informing you that someone else modified your document that it cannot be saved and similar.

To create a workflow you will need program called Microsoft Office Sharepoint Designer (FrontPage successor). Here is what you need to do:

1. Open your SharePoint site with SharePoint designer
2. Choose New > Workflow
3. For workflow start options choose:

a. Automatically start this workflow when a new item is created
b. Automatically start this workflow whenever an item is changed

4. Create only a single step for your workflow and

a. For step condition choose “Compare Documents field” and set it as on figure below
b. Add tree actions (as shown below)

i. Check out item
ii. Set value for encoded URL column
iii. Check in item

5. Save your workflow

workflow

When completed your document library will look like this one (document URL is shown in Encoded URL column):

documents

8 Comments

  1. madhur Says

    the same does not work for lists … rite ?

  2. http:// Says

    cannot see any pictures

  3. http:// Says

    work with errors
    Error
    “file was modify by user……”

    why? (

  4. http:// Says

    Part 1 seems to be lost from a server crash. Can that be reposted?

  5. http:// Says

    @ccalcut:
    I just repaired the broken link. Drop me a line if you need anything else…

  6. Nets Says

    Thanks for this solution, my question is related to this can add the related URL of a docuement in that document by an automate process.

  7. Toni Says

    @Nets: Yes this can be done, but I would need more details in order to help you…

  8. Emmanuel Says

    this pictues dont seem to be working, is there any way you could send them to me please or repair the broken links

Leave a Reply