SharePoint Online: Format Calculated Column as Hyperlink (2023)

Requirement: Format Calculated Column markup as Hyperlink.

How to Format Calculated Column as Link using HTML Markup?

Using calculated column formulas to frame hyperlinks and setting the column type to “Number” renders the column markup as HTML. E.g., I’ve used this formula to link project documents with the Projects list.

=CONCATENATE("<a href='https://crescent.sharepoint.com/sites/projects/documents/'",[ProjectID],">",[Project Name],"</a>")
SharePoint Online: Format Calculated Column as Hyperlink (1)

Well, not anymore in SharePoint Online as per the Microsoft announcement Handling HTML markup in SharePoint calculated fields. SharePoint Online renders HTML markup as text instead of HTML!

SharePoint Online: Format Calculated Column as Hyperlink (2)

So, How to render Calculated columns as HTML markups in SharePoint Online? Here is how:

  1. Make sure the list is in New experience, Format the calculated column
    SharePoint Online: Format Calculated Column as Hyperlink (3)
  2. Use this JSON to format the column markup as HTML.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Project Documents", "attributes": { "target": "_blank", "href": "='https://crescent.sharepoint.com/sites/projects/' + @currentField" }}

Similarly, you can refer to any other fields in the list in JSON as:

"href": "='https://crescent.sharepoint.com/sites/projects/' + [$Project_x0020_Name]"

This JSON renders the text as HTML markup

SharePoint Online: Format Calculated Column as Hyperlink (4)

Here is the Microsoft documentation on column formatting: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting

Format HTML Markup in Classic Sites

On Classic pages, edit the page in the browser, add a script editor web part and place this script in it.

<script src="https://code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function() { var textholder = ""; $("td.ms-vb2:contains('<a href=')").each(function() { textholder = $(this).text(); $(this).html(textholder); });})</script> 

How about SharePoint 2016/2019 On-Premises?
While the above steps work for SharePoint On-premises, You can configure it at web application level settings using PowerShell.

$WebApp = Get-SPWebApplication https://YOUR-web-app-url$WebApp.CustomMarkupInCalculatedFieldDisabled=$False$WebApp.update()

Related Posts

FAQs

How to create calculated Hyperlink column in SharePoint Online? ›

So, How to render Calculated columns as HTML markups in SharePoint Online? Here is how: Make sure the list is in New experience, Format the calculated column. Use this JSON to format the column markup as HTML.

How do I make a column clickable in a SharePoint list? ›

2 answers
  1. Edit Multiple lines of text column. Edit item > select Multiple lines of text column then click "Edit"
  2. Add Hyperlink. Click ellipsis > click "Add or edit hyperlink"
  3. Insert link. Type your URL link and type display text.
  4. If the answer is helpful, please click "Accept Answer" and kindly upvote it.
Dec 17, 2021

How do I Hyperlink a column description in SharePoint? ›

Here is how to do this:
  • Click +Add column > Hyperlink.
  • Give your column a name, click Save.
  • Re-arrange the order of the columns on your Custom list by dragging the column left or right.
  • Add a new entry and populate the URL for the site, the text description for the link. ...
  • Repeat for the other rows in your list.
Dec 24, 2020

How do I format a column in SharePoint online? ›

To open the Format column panel, select a column heading, select Column settings from the menu, and then select Format this column. The Format column panel appears. Copy and paste text from the column formatting JSON reference to columns in your SharePoint list.

How do I convert a column of text urls into active hyperlinks? ›

Hyperlink appears as a regular text string

Solution: Double-click the cell or press F2 to enter the edit mode, go to the end of the URL and press the Space key. Excel will convert a text string into a clickable hyperlink.

How do I hyperlink or image column in SharePoint online? ›

Browse to your SharePoint Online site and navigate to the target list in which you want to add a hyperlink or picture column. Under the List tab, click on the “Create Column” button in the ribbon. Provide the Name to your new column, specify the type as “Hyperlink or Picture”.

How do I add a conditional column to a SharePoint list? ›

On the New item page, click on the “Edit Form” button and then “Edit Columns” as in the below screen. Now, on the “Edit Columns” form, click on the three dots (:) and choose “Edit Conditional formula” from the menu.

How do I create an indexed column in SharePoint? ›

If this occurs, do the operation during the Daily Time Window, or contact your administrator.
  1. Select the name of the list or library in the navigation, or select Settings. ...
  2. Do one of the following: ...
  3. Scroll down to the Columns section. ...
  4. Select Indexed columns.
  5. On the Indexed Columns page, select Create a new index.

How do you insert a hyperlink into a column? ›

Add a Hyperlink field in Design view
  1. Open the table in Design View.
  2. In the Field Name column, select the first blank row, and then type a name for the field.
  3. Select the adjacent cell in the Data Type column, and then select Hyperlink from the list.
  4. Save your changes.

How do I hyperlink a column in sheets? ›

Link to data in a spreadsheet
  1. In Sheets, click the cell you want to add the link to.
  2. Click Insert. Link.
  3. In the Link box, click Select a range of cells to link.
  4. Highlight the cell or range of cells you want to link to. ...
  5. Click OK.
  6. (Optional) Change the link text.
  7. Click Apply.

How do I put multiple hyperlinks in a column? ›

Multiple Hyperlinks in One Cell – Google Sheets

Unlike Excel, Google Sheets lets you insert multiple hyperlinks into a cell without using text boxes. Select the text you want to link (in this case COUNTA) and click Insert Link in the menu (or use the keyboard shortcut CTRL + K).

How do I conditional Format columns in SharePoint? ›

To apply conditional formatting to a column in the SharePoint Online list or library, click on a column header, select Column settings from the menu, and then click Format this column.

How do I change the Format of a whole column? ›

Select the cells with the Excel Style. Right-click the applied style in Home > Cell Styles. Select Modify > Format to change what you want.

Can you edit a calculated column in SharePoint? ›

Changing The Column Type To Date And Time In SharePoint

And click Edit. The Edit column panel will then appear where you can edit the column.

How does the hyperlink formula work? ›

The HYPERLINK function creates a shortcut that jumps to another location in the current workbook, or opens a document stored on a network server, an intranet, or the Internet. When you click a cell that contains a HYPERLINK function, Excel jumps to the location listed, or opens the document you specified.

What is hyper linking? ›

In a website, a hyperlink (or link) is an item like a word or button that points to another location. When you click on a link, the link will take you to the target of the link, which may be a webpage, document or other online content. Websites use hyperlinks as a way to navigate online content.

How do you link a cell in a formula? ›

Create a link to another worksheet
  1. Select the cell or cells where you want to create the external reference.
  2. Type = (equal sign). ...
  3. Switch to the worksheet that contains the cells that you want to link to.
  4. Select the cell or cells that you want to link to and press Enter.

How do I convert plain text links to hyperlinks automatically? ›

Solution: Double-click the cell or press F2 to enter the edit mode, go to the end of the URL and press the Space key. Excel will convert a text string into a clickable hyperlink.

What is the correct HTML syntax to convert some text to a clickable link? ›

To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink. Add the URL for the link in the <a href=” ”>.

How do I add a clickable link to a SharePoint list? ›

Add accessible hyperlinks
  1. Select the Edit link of the section where you want to add the hyperlink.
  2. Select the Add a new web part link.
  3. Select Link in the Web Part menu.
  4. Insert the address of the destination link.
  5. In the Address field, type or paste the URL.

What is indexed column in SharePoint online? ›

Indexed columns add performance benefits in large lists when you frequently filter and query a column. An indexed column in SharePoint Online is a special type of column used to store values that can be used as search keys.

How do I make an image a clickable link in SharePoint? ›

Add a web link to a picture
  1. Navigate to the page with the image you want to add a hyperlink to.
  2. Click the Page tab, and then click Edit.
  3. Click and select the photo or picture you want to an link to.
  4. On the ribbon, click Insert, and then click Link.

How do I use a calculated column in a SharePoint list? ›

On the Settings page, under Columns, select create Column. In the Name and Type section, enter the name that you want in the Column name box. Under The type of information in this column is, click Calculated (calculation based on other columns).

Can you do conditional formatting in SharePoint? ›

You can apply conditional formatting to text or choice fields that might contain a fixed set of values. The following example applies different classes depending on whether the value of the field is Done, In Review, Has Issues, or another value.

Can I use conditional formatting in a SharePoint list? ›

Conditional Formatting SharePoint List View. On the Format view panel, click Conditional formatting. Next, click Add rule. We'll set the rule to if the office is equal to Dallas, then these are going to be highlighted in red.

Can you index a Calculated column in SharePoint? ›

As calculated column is not allowed to index, for all the scenario you can use the workaround of creation of text column and adding the power automate to set the value of it as per calculated formula.

What is the difference between crawling and indexing in SharePoint? ›

Crawling is the mechanism that your site uses to scan all the documents inside of it. Indexing is the process of your site sorting and integrating this information into its search database.

How do I make a column full text indexed? ›

To create a full-text index choose your table and right-click on that table and select the “ Define Full-Text Index” option. Now select Unique Index. It is compulsory that for “Full-Text Index” table must have at least one unique index. Select columns name and language types for columns.

What is the use of hyperlink column? ›

Use the HyperLinkColumn column type in a DataGrid control to create a hyperlink for each row in the DataGrid. Set the Text property to specify the caption text for the hyperlink. To specify the URL to link to when the hyperlink is clicked, set the NavigateUrl property.

What is hyperlink data type? ›

Hyperlink. A link address to a document or file on the Internet, on an intranet, on a local area network (LAN), or on your local computer. Up to 8,192 (each part of a Hyperlink data type can contain up to 2048 characters).

How do you link data from a column to a row? ›

With the Destination range cells selected, type "=TRANSPOSE(" (use Tab to autocomplete). Select the source rows. Press Ctrl + Shift + Enter.

Can you create a hyperlink in SharePoint? ›

Add accessible hyperlinks

Select the Edit link of the section where you want to add the hyperlink. Select the Add a new web part link. Select Link in the Web Part menu. Insert the address of the destination link.

How do I add a hyperlink button in SharePoint? ›

Click on the Insert tab and then clickon the lower part of the Link button. From the drop-down menu select From SharePoint.

How do I create a Calculated column in SharePoint? ›

On the Settings page, under Columns, select create Column. In the Name and Type section, enter the name that you want in the Column name box. Under The type of information in this column is, click Calculated (calculation based on other columns).

How do I create a Quicklink in SharePoint? ›

How to Add the Quick Links web part to a SharePoint Page
  1. Go to the SharePoint page that you'd like to add the Quick Links web part to.
  2. Click Edit on the top right corner of the page.
  3. Click the + icon next to any existing section to add a new section for the Quick Links web part.

How do you use hyperlink options? ›

Create a hyperlink to a location on the web
  1. Select the text or picture that you want to display as a hyperlink.
  2. On ribbon, on the Insert tab, select Link. You can also right-click the text or picture and click Link on the shortcut menu.
  3. In the Insert Hyperlink box, type or paste your link in the Address box.

What is the difference between button and call to action in SharePoint? ›

Similar to a Button, the Call to Action (CTA) web part allows you to highlight something you wish the viewer of your page to do. The differences between the CTA web part and the Button web part are that you can add a background image, and a Call to Action text, which help give more context.

How do I hyperlink directly to a document in SharePoint? ›

Right-click the file that you want to link to, and select Get a link. Choose the type of link you want, and then copy the link. Return to the document library where you want to add the link, and enter that link in the Create link to dialog.

How do I add a calculated column to text in SharePoint? ›

Open the SharePoint list or document library, then click on + Add column -> More… Then it will open the Create Column dialog box, provide a name for the Calculated column and then choose the Type as Calculated (Calculation based on other columns) options.

References

Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated: 13/12/2023

Views: 5301

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.