In this SharePoint Hyperlink in Text Field article, we will learn about how to convert a Single Line of Text Columns to a Hyperlink using Column Formatting in the SharePoint Online list. Many times, in the SharePoint Online list we store the site URL (hyperlink) inside the single textbox column where the user feels a hurdle to manage the link, so for the ease of the user, we need to convert the text type column value to hyperlink.
SharePoint column formatting displays a single line of text as a hyperlink – SharePoint Hyperlink in Text Field
Let’s look at the below example where we have a test list with the two columns “Title” and “Site URL” (Single Line of Text Type).

If we closely, look at the value of the Site URL we could see it is – “www.google.com” which text type.
Now let’s convert this text value to the hyperlink.
Click on the “Site URL” column dropdown list -> Column Settings – > Format this column
Format SharePoint Online text column to hyperlink column then click on the “Advanced mode” link from the right-side panel.

Then replace the out-of-the-box JSON text with the below custom JSON value:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "attributes": { "href": "@currentField", "target": "_blank" }, "txtContent": "@currentField" }


Once we apply the custom JSON and click on the preview button, immediately we can see that the value of the “Site URL” column has been changed from the text to hyperlink.
Now click on the “Save” button.
Now let’s dynamically change the value hyperlink display value, for this example, here it should display “Google” as a hyperlink wherein the background this will link will be pointing to “www. google.com”.
The “txtContent“: “[$Title]” paramter is handling this job.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "attributes": { "href": "@currentField", "target": "_blank" }, "txtContent": "[$Title]" }

Click on the “Save” button.
Note:
- Due to security reasons, this formatting can be done with SharePoint Online URL, so, when you are trying you could try with some test SharePoint site URL.
- In the above code, the “target”: “_blank” parameter indicates that the link should be opened in the new tab of the browser.
Summary: SharePoint Hyperlink in Text Field
Thus in this article, we have learned about how to convert the Single Line Text column to hyperlink dynamically in the modern SharePoint Online list.
See Also: SharePoint Hyperlink in Text Field
You may also like the below article on modern SharePoint Online:
- Customize the list form using JSON in SharePoint Online step by step
- Column header formatting in SharePoint list Quick Edit or Datasheet View
- Learn HTML table formatting using Microsoft Power Automate step by step
- SharePoint Online – O365 – How to create a Tile view in modern SharePoint online lists and configure it.
- Customize SharePoint List Forms Using PowerApps step by step – Office 365
- How to enable SharePoint Syntex in Microsoft 365 tenant?
- Overview of SharePoint Syntex in Microsoft 365
- Field element (Field Types) in SharePoint
Buy the premium version of SharePoint Online & Office 365 administration eBook from here: