cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cckiat9999
Frequent Visitor

How do I extract email address from a string?

Hi, what is the best way to search and extract an email address from a string? Thanks!

 

Sample String:

I am Peter Watts from ABC Co. Ltd. and my email address is pw@abc.com while my phone number is 123-345-567.

1 ACCEPTED SOLUTION

Accepted Solutions
PowerAddict
Super User
Super User

Hi @cckiat9999
I am sure there is a better way to do it but if your text will have only one email address, then you can use this: 

Last(Split(First(Split("Your Text", "@")).Result, " ")).Result & "@" & First(Split(Last(Split("Your Text", "@")).Result, " ")).Result

Let me know if this helps. I will try to come up with a better/cleaner approach. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

3 REPLIES 3
PowerAddict
Super User
Super User

Hi @cckiat9999
I am sure there is a better way to do it but if your text will have only one email address, then you can use this: 

Last(Split(First(Split("Your Text", "@")).Result, " ")).Result & "@" & First(Split(Last(Split("Your Text", "@")).Result, " ")).Result

Let me know if this helps. I will try to come up with a better/cleaner approach. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Thanks, Hardit. This works well. I was thinking if 'Match' function is able to do something similar, since 'Match' and its enum Match.Email is able to tell if there is an email address within the string. Cracked my head for hours and decided to use your way 🙂 Thank you!

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.co

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,953)