Help

Extracting first email in a field with multiple emails

Solved
Jump to Solution
2977 9
cancel
Showing results for 
Search instead for 
Did you mean: 
Kirsten_Kern
5 - Automation Enthusiast
5 - Automation Enthusiast

This may have been covered, but I cannot find it. I have a field that has several emails in it. It is a lookup field I need to extract the first email in the list. Can someone help me with the formula?

1 Solution

Accepted Solutions
Kirsten_Kern
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you! That just eliminated a few extra fields! :partying_face:

See Solution in Thread

9 Replies 9
Zack_S
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi @Kirsten_Kern,

Instead of a Lookup field, use a Rollup field and use the ArrayJoin function
image

Then in your formula field use the following. Replace {Email Rollup} with your reference.

REGEX_EXTRACT({Email Rollup}, "^(.+?),")

Hi Zack,
Thank you for your prompt response.

Works great for all fields except where I only have one email and then I get an error message. Is there a way to fix this?

Move the question mark to after the comma ^(.+),?

REGEX_EXTRACT({Email Rollup}, "^(.+),?")

Thank you; however, that returned all of the multiples. To be clear, I used the second formula and the error message was removed but the extraction of only one email part of the formula gave me multiple emails again. Basically, the second formula with the question mark moved after the comma gave me my exactly what my rollup gave me.

Sorry, I thought that was working for me.

The below does work for me in Airtable.

Try this [^,]*

Brilliant. I am doing the happy dance. Thank you. Those REGEX thingies are like martian speak to me.
:kiss: .

For anyone looking over our shoulders, this was the final formula: REGEX_EXTRACT({One email}, “[^,]*”)

Where, {One email} was my reference field.

They are very new to me as well but are great with some basic understanding :thumbs_up:

Thanks to @Ben.Young. Thought they were scary and never attempted learning them before.

As a bit of a side note, you can actually just write the whole formula inside of the rollup field’s formula configuration.

I’m on mobile right now, so this might look weird or need a tweak, but it would look something like this:

IF(
    values,
    REGEX_EXTRACT(
        values,
        '[^,]*'
    )
)
Kirsten_Kern
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you! That just eliminated a few extra fields! :partying_face: