1

Looking for a way to set a hyperlink address AND display in a list without using a workflow. I'd prefer to use InfoPath. I can do it with a workflow and variables, but want to avoid using workflows this time around.

For example, I need to set the hyperlink address to "https://maps.google.com/?q=39.768438,-86.160216", but set the display to only show "Indianapolis"

I have text columns asking the user for the LAT and LONG (in degrees, minutes, seconds format), and then a column asking to describe the location.

Columns

  1. LAT: 39.768438
  2. LONG: -86.160216
  3. Description: Indianapolis
  4. Hyperlink: (need to calculate)

In a work flow format, I can make variables to process the LAT, LONG as a string, then just set the hyperlink as VAR1, Description, and the list will show the description, but will respond when clicked with the correct location.

1 Answer 1

2

There is a calculated column 'trick' where you return a number type but use regular string concatenation and an html 'a' tag and the item will show up for you as a link...

In the most general case, you can use a text column to define the link value then use a calculated column as the column that you actually display in a list view...

The value for the calculated column you're asking for would look something like this:

="<a href='https://maps.google.com/q="&[LAT]&","&[LONG]&"'>"&[Description]&"</a>"

The brackets aren't strictly required since your fields don't have spaces, but they demonstrate where you're pulling in values from other fields in the same item.

Remember to ensure that your calculated column is returning a number by selecting 'Number' after the prompt at the bottom of the column settings page labeled 'The data type returned from this formula is'. This is important, as data that is returned as a number will be calculated by the SharePoint server... No workflow required!

You can find another answer with similar content here.

3
  • Where would I put that formula? On the column settings page for the hyperlink, I cannot change it to return Number.
    – jammer
    Oct 28, 2014 at 17:42
  • Are you saying dont use a Hyperlink column, but rather, a number column, and put the hyperlink in somewhere?
    – jammer
    Oct 28, 2014 at 17:42
  • Correct, no hyperlink field -- use a calculated column with a return type of number and use the formula in the answer as the formula for the column value.
    – John-M
    Oct 28, 2014 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.