Create a Hyperlink using SharePoint Calculated Column

Are you trying to create a hyperlink in SharePoint? Maybe using a SharePoint calculated column. Microsoft officially does not support and blocks the execution of HTML markup in SharePoint calculated fields.

Alternatively, you can use JSON Formatting to make the hyperlink clickable as a solution for this requirement.

In this tutorial, I will guide you through two examples on how to create a Hyperlink in a SharePoint calculated column:

  1. Create a Hyperlink URL with a calculated column, then apply JSON format
  2. Create a Hyperlink Directly by applying the JSON format
Add a SharePoint calculated column with a hyperlink

Example 1: Create a Hyperlink with SharePoint Calculated Column using JSON Format

In this example, I will show you how to create a website URL for a Hyperlink using a SharePoint calculated column. Then, how to apply the JSON formatting to make the website URL clickable.

I will consider a SharePoint list ‘Training Courses‘ that has Website Titles as shown in the screenshot below. I wanted to create a hyperlink for those websites.

SharePoint Calculated Column Create a Hyperlink

First, let’s create a Website URL using the calculated column.

Follow the steps below:

  1. Open the SharePoint list, click on the + Add column, and select See all column types. Then, click on the Next button, as shown below.
SharePoint calculated column with a hyperlink
  1. Then, on the Create Column page, enter the Column name (Website Full URL), and select the data type as Calculated (Calculation based on other columns).
SharePoint Online calculated column with a hyperlink
  1. Now, add the formula under the Formula box as shown below.
="https://www."&Title&".com"

Make sure to select the “Number” data type to return from this formula. Then, we will only get clickable hyperlinks. Click on the Ok button.

How to add a SharePoint calculated column with a hyperlink
  1. Now, add the title, such as the website name. We will then get a hyperlink without a clickable option, similar to the one below.
How to add a SharePoint Online calculated column with a hyperlink

This way, you can create a Website URL for a clickable hyperlink using a calculated column in SharePoint.

Apply JSON Format to the Created Calculated Column:

Now, let’s see how to make the Website URL a clickable link. See the steps below:

  1. Expand the calculated column, then tap Column settings and select the “Format this column” option.
How to create a SharePoint calculated column with a hyperlink
  1. Next, click on the Advanced mode link, remove the column custom format, and add JSON format; then click on the Save button.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "@currentField"
}
}
How to create a SharePoint Online calculated column with a hyperlink
  1. Then, you can see a hyperlink in the ‘Website Full URL‘ column in the SharePoint list.
SharePoint calculated column with a hyperlink

Check out SharePoint Calculated Column Date Examples

Example 2: Create a Hyperlink in SharePoint Calculated Column Using JSON Format

This example demonstrates how to create a hyperlink in a SharePoint list calculated column using the JSON format.

Check out the steps below:

  1. Open the SharePoint list, click the + Add column, and select See all column types. Then, click on the Next button.
  2. Then, enter the Column name on the Create Column page (User-Friendly URL). Select the “Data Type” (Calculated) and add the formula in the Formula box. Then select the Ok button.
="Website URL"
Create a SharePoint Online calculated column with a hyperlink
  1. Once you add the calculated column, it will appear as shown below. This text is also not clickable until we apply json formatting.
Add a SharePoint Online calculated column with a hyperlink

Apply JSON Format to Calculated Column [User-Friendly URL]:

  1. Expand column header of User-Friendly URL->Select Column settings & Format this column option. Then, click on the Advanced mode link. Paste the following JSON Format and save it.
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "[$Title]",
  "attributes": {
    "target": "_blank",
    "href": "='https://www.' + [$Title] + '.com'"
  }
}
Create a calculated column with a hyperlink from SharePoint Online
  1. Then, we will obtain a clickable hyperlink in the SharePoint list calculated column [User-Friendly URL] like in the screenshot below.
Add a calculated column with a hyperlink from SharePoint Online

In this tutorial, I have covered two methods for creating a hyperlink URL in a SharePoint calculated column by applying JSON formatting to the column.

Do let me know if you still have any questions in the comments below.

You may also like:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…