Extract name from email address

Hi AT community!
Is there a way to extract a persons name from an email address? I have a form that requestors fill in that automatically creates a record. In the form it asks for an email address, and there’s another column for their name.

If column A has the email address they entered, I’d like column B to hold their name.
Also, all company emails follow a pattern of:
fname.lname@domain.com

How can I add “fname lname” into column B? I just need what’s before the dot, and after the dot with a space in between.

Welcome to the community, @Deelemma! :smiley: This can be done using the following formula:

IF({Email Address}, SUBSTITUTE(REGEX_EXTRACT(emails, "[^@]+"), ".", " "))

This extracts all characters up to—but not including—the @ symbol, and then replaces the period in the extracted text with a space.

If you want to capitalize the first letter of each extracted name element, here’s a longer version that will do that:

IF(Email, UPPER(LEFT(Email, 1)) & REGEX_EXTRACT(Email, "(?:.)([^\\.]*)") & " " & UPPER(MID(Email, FIND(".", Email) + 1, 1)) & REGEX_EXTRACT(Email, "(?:[^\\.]*..)([^@]*)"))

Screen Shot 2021-12-13 at 4.40.49 PM

2 Likes

You can use a formula field to extract the parts of the email address. However, note that that would not appear in the form itself. The formula field would be a different field from the field in the form used to enter the name.

There are many different possible formula fields. Here is one that uses regular expressions.

REGEX_REPLACE(Email, "(\\w+)\\.(\\w+)@.+", "$1 $2")

image

2 Likes

OMG with the caps were a nice touch! Thank you all. This puppy is SOLVED!

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.