How to extract Text Content from Gmail via Text Parse

Hi everyone!

I am a new user.
May I know how to extract some info from my Gmail?
Here is what I have done:

I used the Text parse and using the Regular Expression.
How come it gives me two Bundles of Phones, those I only have one match?
Then the two are exactly the same?
Then I have to use tool to iteratively filter only one. But it doesn’t work!

below is my email


Hi AAAAA™,

A new event has been scheduled.

Event Type:

Online Diamond Concierge Service

Invitee:

Andrea ZZZZZ

Invitee Email:

[abc@gmail.com](mailto:abv@gmail.com) [[abc@gmail.com](mailto:abc@gmail.com)]

Event Date/Time:

09:00am - Tuesday, January 23, 2024 (Pacific Time - US & Canada)

Description:

Our complimentary concierges are here to guide you through everything - from understanding the ashes-to-diamond process, to designing your ideal jewelry. Please feel free to raise any questions, concerns or share your stories. We are happy to listen and serve you.

Location:

This is a Zoom web conference.

Attendees can join this meeting from a computer, tablet or smartphone.

https://us05web.zoom.us/j/605783456?pwd=aWEvYlRxWHc5T50WjlVVGxWOHZXdz09&omn=8411933336 [https://us05web.zoom.us/j/605788888?pwd=aWEvYlRxWHc5T650WjlVVGxWOHZXdz09&omn=8411933336]

Password: 54xxx

Invitee Time Zone:

Eastern Time - US & Canada

Questions:

Preferred method of communication

Zoom (by default)

What is your phone number?

+1 626-622-1234

View event in Calendly [https://calendly.com/app/scheduled_events/user/me?period=upcoming&uuid=7beb1345-74f0-4cc5-85f2-0cd1921aae0e]

Add to Google Calendar [[https://calendly.com/invitees/8c7eadf1-1d94-497d-a1db-f6dae5b109bc/google]Add](https://calendly.com/invitees/8c7esdfaee1-1d94-497d-a1db-f6dae5b109bc/google%5DAdd) to iCal/Outlook [[https://calendly.com/invitees/8c7eaee1-1d94-497d-a1db-f6dae5b109bc/ics]Calendly](https://calendly.com/invitees/8csafee1-1d94-497d-a1db-f6dae5b109bc/ics%5DCalendly) will automatically add scheduled events if you connect your calendar [https://calendly.com/app/calendar_connections]

PRO TIP!

==================================

I want to get
Event Date, Invitee,Invitee email, Event Type




image

Thanks so much for you time!

1.

Could you format your Email content by editing three backticks ``` before and after the code, like this:

```
input/output bundle goes here
```

2.

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

Make sure you re-copy and paste the email here, since the forum software might have changed a few characters!

2 Likes

Try this regex instead in the text parser

(\+\d{1,2}\s?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4})

I don’t think you need to worry about the preceeding and succeeding white space as this will capture only the phone number in various different patterns. It comes from this useful post.

2 Likes

Thanks for the tip, I applied the first option.

2 Likes

Thank you Alex,
But the phone, sometimes are not only from US.
Can be in other format.
So what I am thinking is just getting the Number between “What is your phone number?” and “View event in Calendly”

Thank you for your reply :grinning:

2 Likes

Welcome to the Make community!

You can use a Text Parser “Match Pattern” module with this regular expression pattern

your phone number\?\s*(?<phone>\+?[\d\s-]+?)\s*View event

Regex test: https://regex101.com/r/lzhyOM


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

Hi samliew,
Thanks for your reply.
Since the “View event” is now always showing.
So I change the RX pattern like this:

What is your phone number\?\s*([\+\d\s\-]+)\s

However, I still get two bundles, please help me how to only get the one?

Also, since the Calendly email, one is the text, the next one is the email link,


it also always getting two, how can I only get one?

Ah, you need to turn off “Global Match” in the Email parser module [5] (set it to “NO”).

Otherwise two bundles come out of it, triggering the subsequent modules more than once.

3 Likes

cant we use this regex to match phone numbers? :+\d{1,}\s\d{1,}-\d{1,}-\d{1,}

Btw \d{1,} is the same as \d+

And not all phone numbers use dashes, especially those not from the U.S.

2 Likes

Yeah i saw when i used that regex inside make it returned me the text string and not the phone number

This is a default Text parse.
How to set Global Match to NO?

Oops. That module matches all emails globally. If you use the “Match Elements” module, there could potentially have multiple matches, and multiple bundles as the output. The keyword here is the plural “elements”.

You’ll need to use a Text Parser “Match Pattern” with an email pattern just to match a single email.

\b(?<email>[\w._+-]+@[\w.-]+\.\w+)\b

Screenshot_2024-01-29_160149

Regex test: https://regex101.com/r/7GKShR

Output, matching only the first email - Global match is “No”

Screenshot_2024-01-29_160109

Alternatively, you can use a Text Aggregator to combine all the outputs into a single text/string variable, but that’s an additional operation wasted if you only want a single email.

3 Likes

Thank you very much! That works!

No problem, glad I could help!

I briefly saw your updated question about making more matches, if you still need help, or want to explore optimising your scenario (might be possible to combine the parser modules into a single one), feel free to open a new thread!


1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

wow, if I could merge into one, that would be great!

Thanks, I will mark it as helpful replies!

Hi everyone,

I am facing a new issue.

May I know if I don’t merge my Text pasers into one, am I charged each node 1 time?
So totally each time I have to charge 5 times?

I am using my 1000 quotas today.
And now it’s all gone, all finished so fast!

I used the 15min as the trigger,
But still, how can I use it so fast?

Can I receive one email and then trigger it once?

Thanks!

Did you set Global Match to No?

If it’s a Yes, you need to aggregate the results, otherwise each bundle generated will cost one operation each for future modules.

Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

2 Likes