Setting a SharePoint Hyperlink to a Workflow in SharePoint Designer 2013
A recent request from one of our clients was being able to start a workflow from a link within the actual item. In their case, they have a list of events and wanted a link to the workflow and a different description other than the actual hyperlink. In this client’s case, the text ‘Enroll Now’ next to each item which would then start a workflow that does everything needed for their enrollment process. Seems like it should be fairly simple right? It is, unless you factor in 1 large “gotcha”.
Hyperlink Process
Creating the Hyperlink Field in SharePoint Designer
Creating the hyperlink with a description using SharePoint Designer 2013 isn’t easy, but isn’t hard either.
- In the list where you want the hyperlink, add a hyperlink field.
- Open SharePoint Designer 2013 to the list that contains the hyperlink field
- Create a new workflow – when we use a workflow explicitly to set fields, we tend to name them as such: ‘Set Enrollment Link URL’
- In the top-right, click ‘Local Variables’ and add a string field such as ‘Enrollment Link’
- In the workflow, add the Action ‘Set Workflow Variable’
- Click ‘workflow variable’ in the action and choose ‘Variable: Enrollment Link’
- Click ‘value’ in the action and click the 3 dots (…) on the right
- Here is where you are setting the URL and description. Add the URL here followed by a comma, then a space and then whatever wording you want in the hyperlink. There should not be any quotes around the URL or around the wording you want, even if it is more than 1 word. For example, you may have http://technet.microsoft.com/, Great Reference Material
- Once done with the URL and description, add the workflow Action ‘Set Field in Current Item’
- Click ‘field’ in the Action and choose the hyperlink field you created in Step 1
- Click the ‘value’ in the Action and choose ‘workflow Variable and Parameters’ and select the variable ‘Enrollment Link’
- Finish up any other actions or conditions you may have for the workflow, including the End Workflow stage and publish the workflow. Don’t forget to dictate when the workflow should start (manually, on create or on update).
Ask Us About Workflow Automation
The ‘Gotcha’
When you are working with SharePoint workflows, the actual URLs are massive and contain more parameters than what’s needed. There is a 256 character limit on hyperlink fields as noted here. You really need to work with the workflow parameters and the overall architecture of SharePoint to keep a workflow URL below 255 characters. What happens if you exceed 255 characters? As of writing this article, SharePoint 2013 simply hangs for ~24 hours before determining the workflow won’t work… and it ends up in suspended state with an error message stating the URL format is not valid. Eep!
Need help with building SharePoint workflow URLs?
As mentioned there is a lot to factor in when building a SharePoint workflow URL, especially in SharePoint 2013. There are extra variables not needed, you need to determine where the workflow should send you once it’s done and overall it needs to stay within 256 characters. Fortunately, we have done so many SharePoint architecture designs as well as custom development we can gladly assist you with any help you may need. Simply gives us a call and we will be glad to help!