Extracting name & email address from an email

Thanks in advance, I’m a total newbie here.

Goal
I’m trying to extract the name and email from an automated email I get when a contract is signed.

So far I was able to:

  1. Successfully watch the email
  2. Route
  3. Text Parse - Match Pattern
  4. The issue is here when I try to add a row to a google sheet. error below.

This is the email I receive:

I don’t need the email under requester, I need the name underneath, and the email in the () beside.

Here is the setup:

I get this error: The operation failed with an error. 400: INVALID_ARGUMENT - Requested writing within range [‘contains: text parser module’!A2], but tried writing to column [B].

Here is the sheet:

Here is what I put where the error occurs:

Thanks for the help!!

When reaching out for assistance with your regex pattern for a Text Parser module, it would be super helpful if you could share the actual text you’re trying to match. Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.

Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets. Thanks a bunch!

2 Likes

Thanks and no problem.

In the screenshot where I blacked out some things, that’s the info that comes in the email. It’s just a first name, last name and email.

ex of email from the image:

Requester
jeff@gmail.com
Loren Goodtree (lg@gmail.com)

To view the completed version, please see the file attached.

Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Requester\n.+\n(?<name>.+?)\s\((?<email>[^)\n\r ]+)

Proof

https://regex101.com/r/ix6Tf4

Important Info

  • :warning: Global match must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

2 Likes

I’m tryin to understand the proof.

It didn’t grab the email.

I tried this and the proof worked: Requester\n.+\n(?.+?)\s(([\w.-]+@[\w.-]+).

Does this make sense?

Also will this give me both emails to input into the Row?

Oh you want the email too? Updated above.

1 Like

I put this in the text parser, ‘Patter’ field: Requester\n.+\n(?.+?)\s((?[^)\n\r ]+)/gm

Here’s what I have Google Sheet:

After running it, I got this from the parser, input bundle:
“text”: “Requester\n\njeff@gmail.com\n\nLoren Goodtree (lg@gmail.com)\n\nTo view the completed version, please see the file attached.\n\nBest,\n\nMatt Hernandez\n”

No Output.

Nothing went to the google sheet obviously.

Any ideas on what I’m missing?

According to your input bundle, there are two newlines between each line.

This is different from what you provided earlier, which was

It looks like you need to add one more newline \n in the regex like this:

Requester\n\n.+\n\n(?<name>.+?)\s\((?<email>[^)\n\r ]+)\)?

https://regex101.com/r/JuAqqK

2 Likes

This time the input bundle: “text”: “Requester\n\njeff@gmail.com\n\nLoren Goodtree (lg@gmail.com)\n\nTo view the completed version, please see the file attached.\n\nBest,\n\nMatt Hernandez\n”

Output bundle:

[
{
“name”: “Loren Goodtree”,
“email”: “lg@gmail.com
}
]

Success! It read it!

BUT…

still getting the sheet error:

This is what the sheet looks like:

I got it! :grinning:

I changed the name of the worksheet to ‘Details’ and refreshed everything.

Funny the only reason I names the worksheet ‘contains: text parser module’.
is because I was following this at first: https://www.make.com/en/help/tutorials/how-to-connect-email,-text-parser-and-google-sheets

Thanks for the help!

2 Likes

Oh wow, did that colon “:” in the sheet name caused that error message? I’d never could have guessed!

1 Like

Hello @Matt_Hernandez welcome to the Make Community :wave:

I just want to quickly say congrats on getting this up and running with the expert assistance of @samliew :muscle:

Thanks a lot for stepping back into this thread and sharing your final setup for the benefit of the community. We all 100% appreciate it. :pray:

FYI: I marked your last comment as a solution to keep the community organized and easy to search for answers.

1 Like

Yes @samliew was great!

I didn’t want to go to bed until I solved it so I slept great last night!

This is all new to me, so really grateful for the help.

Onto the next process!

2 Likes

Hi There,

Not sure what’s going on here, but the text parser says it worked but then the next step of adding the row to the google sheet didn’t execute. Doesn’t give me an error or anything. (I’m on the free plan FYI)

Regex - Requester\n\n.+\n\n(?.+?)\s((?[^)\n\r ]+))

Looks like there are some spaces around the text. You’ll need to provide the EXACT text here including all spaces.

To do that, formatting is crucial.

A.

Save each bundle contents in your text editor, and upload it here into this discussion thread.

Uploading them here will look like this:

text.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted text in this manner:

  • Either add three backticks ``` before and after the text, like this:

    ```
    text content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

This will allow others to better assist you. Thanks!

3 Likes
[
    {
        "text": "You've been copied on the document: ZipLunch Restaurant Agreement_Slice Baby Slice\n\nRequester:\njeff.mashregi@ziplunch.com\n\n    Signer:Yannick Bigourdan (yannick@klty.ca)\n\n\n    To view the completed version, please see the file attached.\n\n--\nThanks for going paperless!\n\nThe Dropbox Sign Team"
    }
]
You've been copied on the document: ZipLunch Restaurant Agreement_Slice Baby Slice

Requester:
jeff.mashregi@ziplunch.com

    Signer:Yannick Bigourdan (yannick@klty.ca)


    To view the completed version, please see the file attached.

--
Thanks for going paperless!

The Dropbox Sign Team

I’m not sure which one is better. Let me know for future reference.

Thanks!

Here’s the updated regex:

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Requester:\s+(?<requester_email>[^)\n\r ]+)\s+Signer:\s?(?<signer_name>.+?) \((?<signer_email>[^)\n\r ]+)\)

Proof

https://regex101.com/r/GdKr5h

Important Info

  • :warning: Global match must be set to NO!
3 Likes

It worked!!!

Awesome, thanks :pray:

2 Likes