0

I have a SharePoint list as "Training Courses" and inside this, I have added a calculated column named "Website URL".

Here, My requirement is if a user enters the website name in the title column, then we will get Website URL under the calculated column.

enter image description here

Please, suggest any formula for implementation...

2
  • All the websites will have same URL format? For example: https://www.spguides.com and https://www.enjoysharepoint.com. Commented Jul 25, 2023 at 11:27
  • Yes, same URL format
    – Ganesh M
    Commented Jul 25, 2023 at 11:42

1 Answer 1

1

SharePoint online calculated columns does not support HTML anymore to create a clickable hyperlink.

So, I will suggest you to use the JSON formatting to make it clickable.

Solution 1:

  1. Create a Website URL calculated column with this formula: ="https://www." & [Title] & ".com"
  2. Apply JSON column formatting for your calculated column using this JSON:
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "attributes": {
    "target": "_blank",
    "href": "@currentField"
  }
}

Output:

enter image description here

Solution 2:

  1. Create a Website URL calculated column with simple formula like: ="Website URL"
  2. Apply JSON column formatting for your calculated column using this JSON:
{
  "$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'"
  }
}

Where Title is the name of your internal column storing website name. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?

Output:

enter image description here

Apply JSON column formatting by following steps given here: Use column formatting to customize SharePoint

10
  • 1
    Thanks a lot sir
    – Ganesh M
    Commented Jul 25, 2023 at 12:28
  • You're welcome! Commented Jul 25, 2023 at 12:29
  • JSON format is not working (In 1st solution) sir
    – Ganesh M
    Commented Jul 26, 2023 at 6:26
  • Solution 2 working for you? For solution 1, you have to apply JSON formatting to your calculated column and not Title column. Also, what do you mean by not working, is it not showing link or link is non-clickable? Commented Jul 26, 2023 at 7:01
  • Here, Link is Not showing and I applied JSON format to the calculated column only
    – Ganesh M
    Commented Jul 26, 2023 at 7:09

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.