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.
Solved! Go to Solution.
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
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
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
196 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
261 | |
85 | |
71 | |
69 | |
66 |