Print this page

Why does my formula field that displays an email address have two clickable links?

Knowledge Article Number 000006240
Description

Why does my formula field that displays an email address have two clickable links?

The regular expression we compile to match URLs (and emails), includes pattern matching for registered top level domains (TLD). If any email address displayed in a Formula Field contains one of these strings with dot notation before the '@' symbol, the "emailto" link will not output as expected.

Scenario:

  • An org has a text formula field which simply copies an email field value (e.g. formula syntax = Custom_Email__c)
  • The email address in Custom_Email__c meets the criteria described above.


EXAMPLES:

1. "test.travel@yakyak.com". Renders two anchor links (test.travel / yakyak.com), with no mailto link.
2. "test.travelx@yakyak.com". Renders the full mailto link (mailto: test.travelx@yakyak.com).
3. "test.travel.x@yakyak.com". Renders an anchor link (test.travel) and a mailto link (.x@yakyak.com)
4. "test.com@gmail.com". Renders same as #1 (test.com / gmail.com) due to '.com' being a listed top level domain.


 

 

Resolution

The workaround for this behavior is to update the formula field syntax from just –

Custom_Email__c

- to -

HYPERLINK("mailto:"& Custom_Email__c, Custom_Email__c, "_self")

This updated syntax works to trigger the email client to send an email to the correct address instead of parsing out the components of the email address.





promote demote