function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RishuRishu 

Formula to Truncate the text of email field after .com

Hi Team,

I want to Truncate the text or any value that is coming after .com in email field. ( Using formula field )

For eg :-
Input : - gandhi@gmaill.com.abc ( length after .com can be variable)
Output:- gandhi@gmail.com
AnkaiahAnkaiah (Salesforce Developers) 
Hi Rishu,

You cannot do this via a formula field. You will have to do it with a trigger.

Refer the below link will help you to resolve the issue.

https://salesforce.stackexchange.com/questions/54031/can-anyone-help-with-a-formula-to-pull-an-email-address-from-a-text-string-in-a

Let me know, if Still facing issues will help you with code.

If this helps, Please mark it as best answer.

Thanks!!
RishuRishu
Ahh!! Thanks
The actual use case was bit different we don't want to go through triggers.

We were implementing flows on actual requirement and there we are getting stuck on comparison of username.

We thought we can pull the domain name from username using formula and then we can compare it to our use case