Aug 03 2022 11:48 AM
Hi Guys - is there a way of adding a selectable/dynamic email address to a list where that address isn't part of the same domain as SharePoint i.e. the email address of a project partner / client?
Aware I can add in a text field, but then the email address isn't 'clickable'?
Any suggestions appreciated.
Aug 03 2022 01:12 PM
@jacobite You can use column formatting to create a clickable link in list view. Check this https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#add-an-a...
Aug 03 2022 10:54 PM
Solution@jacobite Yes, it is possible to convert the text field to clickable text in list view using column formatting. Follow below steps:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"href": "='mailto:' + @currentField"
}
}
Output:
Documentation: SharePoint column formatting
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Aug 04 2022 12:50 AM
Aug 04 2022 01:03 AM
@jacobite You're welcome, happy to help. Glad it worked for you!
Please consider giving a Like if my post helped you in any way.
May 25 2023 04:43 PM
@ganeshsanap This is helpful, but now, if the user clicks on the same field and it is empty, Outlook opens up. How do I make it so that it only adds mailto: on fields that are not blank?
May 25 2023 05:01 PM
May 25 2023 10:44 PM
@markm4g You can also use below JSON instead which shows/hides the anchor element based on the value of current column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"href": "='mailto:' + @currentField"
},
"style": {
"display": "=if(@currentField, 'block', 'none')"
}
}
OR
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"href": "='mailto:' + @currentField"
},
"style": {
"display": "=if(@currentField != '', 'block', 'none')"
}
}
Related read: SharePoint JSON formatting: Check if column is blank/empty
Please consider giving a Like if my post helped you in any way.
Aug 29 2023 09:46 AM
Aug 29 2023 10:34 PM - edited Feb 01 2024 02:28 AM
@bryanfrumkin47 You cannot pass the HTML, images, hyperlinks, or attachments using mailto protocol as it only accepts string/text values as input.
Check my answers at:
Please consider giving a Like if my post helped you in any way.
Aug 31 2023 08:44 AM
Jan 31 2024 12:51 PM
Your solution is very useful. I have multiple persons in my Assigned to column and when i click on the link the email pops up with each person's email in the Send to: field. I need, if possible, to have each person receive an individual email as part of the Approval process.
Feb 01 2024 02:34 AM
In case of multiple selection person column, you will have to generate the mailto link for each user using "forEach" and click on each link manually to send email to respective user.
Check this JSON sample for your requirements: Multi-Person Mail To Link
Output:
Please consider giving a Like if my post helped you in any way.
Aug 03 2022 10:54 PM
Solution@jacobite Yes, it is possible to convert the text field to clickable text in list view using column formatting. Follow below steps:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"href": "='mailto:' + @currentField"
}
}
Output:
Documentation: SharePoint column formatting
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.