1

I'm working on a formula field to capture the domain details from the website and I have created the below formula

If(NOT(ISBLANK(Website)),SUBSTITUTE(Website, LEFT(Website, FIND(".", Website)), NULL), Domain_from_lead__c )

It's working fine except for the below cases.

  1. https://example.com
  2. http://example.com
  3. http://www.example.com/in/es

Could you please help me to handle these cases

2
  • A regex may be necessary here, but I will say that a domain will never include a forward slash, so you can safely ignore forward slashes beyond http(s):// and any characters after that slash. Do you also need to account for subdomains? Like maps.google.com or salesforce.stackexchange.com?
    – nbrown
    Commented Nov 15, 2021 at 13:19
  • 1
    Check out the answer on this Q&A
    – nbrown
    Commented Nov 15, 2021 at 15:09

0

Browse other questions tagged .