Best answer

Formatter by Zapier Regular expression

  • 4 February 2023
  • 3 replies
  • 175 views

Userlevel 1

My goal is to extract Name and Phone number from a particular email and send that information in a slack channel.

 

STEP 1: Using Event: New Email Matching Search I am able to located the email to search for.

STEP 2: I then am using Formatter by Zappier to extract the name

                    Event: Text

                  Transform: Extract pattern

                   Pattern: (?<=\*First Name\*:\* )[a-zA-Z ]*

STEP 3:  I then am using Formatter by Zappier to extract the name

                    Event: Text

                  Transform: Extract pattern

                   Pattern: (?<=\*Applicant's Daytime Telephone Number:\* )\d{10}

STEP 4: Sending message in Slack

 

My sample Date:

A*First Name*:* Hello
*Last Name*:* test
*Date of birth (mm/dd/yyyy)*:* 2023-02-01
*Applicant's Daytime Telephone Number:* 1234567890
*Applicant's Mobile Telephone Number:*
*Applicant's Email address:*
 

 

In the above example I would extra “Hello” and “1234567890”

 

Is there a way to combine Steps 2 and 3 into one step? 

icon

Best answer by simplifywork 4 February 2023, 02:27

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 2
Badge

Short answer: not with regular expressions (and possibly not at all, depending on source/format/other things)

 

Long(er) answer: regular expressions are really powerful, but they’re limited by the type of character you’re searching for and/or the order in which those characters appear in a given body of text. They’re great at finding/extracting regular patterns, but combining letters and numbers in unpredictable ways with lots of characters in between them is too irregular. 

If it’s any consolation, if your solution is currently working then it looks like you probably have the best solve for your particular situation. 

 

With that said, the formatting you shared seems to suggest that the data is originating from a service that isn’t the email itself. Do you have direct access to the original data source? If so, you could cut out the email entirely and possibly save time (and zaps!) in the process. If you have direct access to the data source, let me know and we can work through a solution together!

Userlevel 1

Thanks for your reply, it was very helpful. Side question how many zaps am I using in my case?

Userlevel 7
Badge +9

Heya @hippopotamuschicken! It’s tough to say without knowing the entirety of the workflow you’re considering. 🙂

A lot of it would depend on:

1.) If you have access to the original source, as @simplifywork mentioned

2.) If Zapier offers an integration for that app

If the first is true, I might recommend checking out our directory of apps here to see if there is an applicable trigger related to what you’re looking to achieve.

Otherwise though, as they also mentioned, it sounds as if you’ve found the best solution for your needs - which is awesome! 🤗