# Extract text from gmail body to GSheet

**URL:** <https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014>\
**Category:** Questions\
**Tags:** google-sheets\
**Created:** [March 28, 2024, 6:54pm UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014 "2024-03-28T18:54:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bonzai\_Marketing](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bonzai_marketing/32/30439_2.png) [@Bonzai\_Marketing](https://community.make.com/u/Bonzai_Marketing)\
**Post date:** [March 28, 2024, 6:54pm UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/1 "2024-03-28T18:54:17Z")

</div>

Hi! I need to extract specific informations (name, email & phone number) from a gmail body, and send it to specific gsheet rows.

I am stuck where I need to extract the correct informations. Here are some screenshots with the informations I need to extract (red arrows) and where they need to go :

 ![Capture d’écran, le 2024-03-28 à 14.51.24](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/c/ec2f5c80c92c1afcac97b6366b9f1ef5c6b3caae.png)  
 ![Capture d’écran, le 2024-03-28 à 14.53.01](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/5/7595399ce524484fb240386e0f7b8a892e80cf58.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 28, 2024, 11:43pm UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/4 "2024-03-28T23:43:44Z")

</div>

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 please **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!

---

<div class="post-metadata">

**Author:** ![Bonzai\_Marketing](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bonzai_marketing/32/30439_2.png) [@Bonzai\_Marketing](https://community.make.com/u/Bonzai_Marketing)\
**Post date:** [March 29, 2024, 11:29am UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/5 "2024-03-29T11:29:32Z")

</div>

No problem. Here is the texte I would like to match 🙂

Name : Lead name  
Email : [lead@email.com](mailto:lead@email.com)  
Phone : 45012345678  
Message : test

Have a nice day

* * *

So I need the 3 first variables (Name, Email & Phone) to be sent in my Gsheet.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 30, 2024, 10:40am UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/6 "2024-03-30T10:40:47Z")

</div>

Welcome to the Make community!

 ![Screenshot_2024-02-20_151445](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/3/a/3a0c58927f26b0aa42ae058e92d98af878686a3a.png)

You can use a Text Parser “[Match Pattern](https://www.make.com/en/help/tools/text-parser)” module with this Pattern (regular expression):

```plaintext
Name : (?<name>[^\n]+)\s+Email : (?<email>[^\n]+)\s+Phone : (?<phone>[^\n]+)

```

# Proof

[https://regex101.com/r/XR7Mw5](https://regex101.com/r/XR7Mw5)

### Important Info

- ⚠ **Global match** must be set to **NO**!

* * *

For more information, see [Text Parser](https://www.make.com/en/help/tools/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](https://en.wikipedia.org/wiki/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.
> 
> - The complete list of metacharacters can be found on the [MDN web docs website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
> - For a tutorial on how to create regular expressions, we recommend the [RegexOne website](https://regexone.com/).
> - For an easy, quick regex generator, try the [Regular Expressions generator](https://regex-generator.olafneumann.org/).
> - For experimenting with regular expressions, we recommend the [regular expressions 101 website](https://regex101.com/). Just make sure to tick the ECMAScript (JavaScript) FLAVOR in the left panel.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Bonzai\_Marketing](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bonzai_marketing/32/30439_2.png) [@Bonzai\_Marketing](https://community.make.com/u/Bonzai_Marketing)\
**Post date:** [April 2, 2024, 7:34pm UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/7 "2024-04-02T19:34:31Z")

</div>

Thank you so much, looks like it’s now working!

Yohan

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [April 17, 2024, 6:15am UTC](https://community.make.com/t/extract-text-from-gmail-body-to-gsheet/32014/8 "2024-04-17T06:15:18Z")

</div>


