Skip to main content

Extractic the very last email from a field

  • July 5, 2022
  • 2 replies
  • 30 views

Forum|alt.badge.img+6

Hello there,
I am trying to extract the very last email that is input into a field.
Example of data would be:

godzilla@gmail.com, mouse@gmail.com, waterbottle@gmail.com

I want to grab the very last email no matter how many emails are input in the field. I have tried using a combination of RIGHT() and MID() but so far haven’t been successful.

Thank you all in advance!!!

2 replies

Forum|alt.badge.img+16
  • Inspiring
  • July 5, 2022

Hi @Alex_Lawson
Can you try this?

LEFT(
    ARRAYJOIN(
        {Emails}
        )&',',
    FIND(
        ',',
        {Emails}&','
        )-1
    )

Forum|alt.badge.img+6
  • Author
  • New Participant
  • July 5, 2022

Hi @Alex_Lawson
Can you try this?

LEFT(
    ARRAYJOIN(
        {Emails}
        )&',',
    FIND(
        ',',
        {Emails}&','
        )-1
    )

Hi @Vivid-Squid
Thanks a lot for the reply!

I tried it but it only grabs the first email. Also tried it using RIGHT() instead and it kind of worked.

These are the email examples I used:
godzilla@gmail.com, mouse@gmail.com, waterbottle@gmail.com, phone@gmail.com, milo@gmail.com

And this was the ouput:
m, milo@gmail.com,