Friday, December 6, 2013

How to set hyperlink url and display name in Sharepoint Designer workflow

A Hyperlink field is made up of two separate parts, the clickable display name and the actual URL. In SharePoint Designer Workflow there is only one field to set for both values.

I was creating a custom 'My favorites'  list when this problem came up. I wanted to create a simple workflow in a document library where users could opt to create links to certain documents in the favorites list by running the workflow for each of these items.

The central part of the document library workflow is of course the create item action. The action is simply set to create an item in the favorites list that sets the item's URL field. I created a workflow variable where I define the string that will hold both the link's display name and URL. Thus the first action of the workflow is to update the variable.

In the string builder dialog simply put together: [%Current Item:URL%], [%Current Item:Name%]. The URL and display name is thus separated by a comma and space. Both of these are important.


3 comments: