0

We are using SharePoint 2019 On premises.

I have a column called "Email" that give the email address of the connected user, but in plain text.

I would like in another column to make this data as a link. So I created a calculated field. I tried several option found here and there, but it still doesn't work.

1
  • I guess you want to use mailTo? SharePoint should render email-adresses in a list as link as default. Are they not links already even thought the list column is single line of text? Commented Jun 1, 2022 at 9:06

1 Answer 1

0

Microsoft officially does not support HTML markup in SharePoint calculated fields and they have blocked the execution of HTML markup in calculated fields.

More details at: Handling HTML markup in SharePoint calculated fields


Now, solution for your requirement is based on if you are using classic experience or modern experience:

1. Classic experience:

If you are using classic experience, you can make the email address clickable using Client Side Rendering (CSR)

2. Modern experience:

If you are using modern experience, you can make the email address clickable using JSON formatting.

For example:

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "children": [
        {
            "elmType": "span",
            "style": {
                "padding-right": "8px"
            },
            "txtContent": "@currentField"
        },
        {
            "elmType": "a",
            "style": {
                "text-decoration": "none"
            },
            "attributes": {
                "iconName": "Mail",
                "class": "sp-field-quickActions",
                "href": {
                    "operator": "+",
                    "operands": [
                        "mailto:",
                        "@currentField",
                        "?subject=Task status&body=Hey, how is your task coming along?.\r\n---\r\n",
                        "Click this link for more info. http://contoso.sharepoint.com/sites/ConferencePrep/Tasks/Prep/DispForm.aspx?ID=",
                        "[$ID]"
                    ]
                }
            }
        }
    ]
}

Reference: Add an action button to a field (advanced)

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.