Displaying A Customized URL In A SharePoint List Form

My SharePoint Buddy called me today and asked if I could look at something she was trying to do. She had a list form (customized with InfoPath) where she wanted to display a clickable URL that was customized based on a field value in the list. Regardless of how we tried to use calculated values and such, we couldn’t get a clickable URL when she opened the form for display. I did a little research and playing around, and I came up with a nice hack (at least I thought so).

So here’s the basic function we were after (ignore everything but the last two fields… I “repurposed” a test list for this). The URL would be clickable, and was customized with the value in the Search Word field:20140521Image01

The first step was to put a Hyperlink column in the list:20140521Image02

I then went into the form design, right-clicked on the Hyperlink control, and made it “Read-Only” (since we only wanted people to use the link, not to edit it):20140521Image03

Off to SharePoint Designer… I set up a workflow that, when triggered, would built the custom URL in a workflow variable, and then put that variable into the Calculated URL field we added to the list:20140521Image04

In the Set Workflow Variable action, I just took the first part of the URL, added the field that had the custom value, and then added the end of the URL (in this case, we were building a URL for a search result page):20140521Image05

Once the workflow was run, the Calculated URL field was added properly, and the customized form would display it as a clickable link. Exactly what we were after.

She then took it one step further… instead of displaying the URL value like I did on my test page, she just created a link on the page called Description, and set the value of that link to be the contents of the Calculated URL field. So now, the form looks clean, the visible clickable link is the same on all the forms, and the underlying URL in the link is the customized value.

I love when these things work. 🙂

 

4 responses to “Displaying A Customized URL In A SharePoint List Form

  1. Nice work! I’ll be filing this away to remember how you did this.

  2. I think I tried doing this some time back, and couldn’t figure out how to make it happen. A good example of “ask me again in six months, I’ll know more by then.”

  3. Yeah, that happens a lot around here too… The more you know…

  4. Nice work! I followed your steps but the problem is when am running the form, since I set the Hyperlink to read-only mode I can not see it in the form.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s