2

I have a list in my SharePoint Online site. The list has a single line of text column for email address. I want to make the values in this column clickable so that when a user clicks on the value it opens in Outlook. This is possible if a column is "Hyperlink" type but not if it is "Single line of text".

I have noticed that if a column is single line of text and you add a email address and open it with "Quick Edit", the value in the field is [email protected]. So, the email should be clickable but when you click on the link, nothing happens.

Do you know if there is a script that can be added to enable this functionality?

Thanks,

Ricky

1 Answer 1

4

This can be done with the new column formatting options in O365. On the listview, use the menu for your single line of text and choose Column Settings > Format this column. This will open the Format column display pane where you can paste the following to have the contents automatically turned into a mailto link.

{
    "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
    "debugMode": true,
    "elmType": "div",
    "children": [{
        "elmType":"a",
        "txtContent":"@currentField",
        "attributes":{
            "href":{
                "operator":"+",
                "operands":[
                    "mailto:",
                    "@currentField"
                ]
            }
        }
    }]
}
0

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.