Extract just name portion from a string
How can I extract just the email ID portion from a string containing both name and email ID. For example, John Doe <john@gmail.com> and pass the extracted email ID to another field in a journey?
0
-
Hi @Shilpa
You can use this formula for retrieving the email id from the above mentioned String.const str = "John Doe <john@gmail.com>";
const match = str.match(/<([^>]+)>/);
if (match) {
match[1];
} else {
"No email found";
}
Also, if this fails to retrieve email id from the string then it will say "No email found". So you can handle next steps based on the "if" condition as per your needs.0
Please sign in to leave a comment.
Comments
1 comment