Text Parser and google sheet

hello ,
I am new here , and i need help

I’m trying to pull specific data from each email notification that I receive, but I’m not a coder and believe that I need the text parser module.
I want to extract a part of an email i recieve and put it in a row in googlesheets

attatched is the part of the email that i need .

I know what i need to to do is use the Text Parser

Please help me

I need help on how to use the

Welcome to the Make community!

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.

  • Either add three backticks ``` before and after the code, 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!

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Thanks so much for your quick reply

This is what i need to be extracted


MTN CORPORATE GIFTING 10GB to 08033480938 Reference ID Is : #202406011759b2a5b4f258e7415d

thats the text sample i am trying to match
thanks

I require the full cell contents from the Sheet, not just the text you want to extract.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like
logo
[https://app.discountdata.ng/assets/images/full-logo.png]https://app.discountdata.ng

Discount Data - Nigeria's topmost enterprise solution to your telecom needs.


NOTIFICATION ALERT

Hi staffdd,

Glo CORPORATE GIFTING 1GB - 30 Days to 08110768733 Reference ID Is :
#202406131022Y5WSUG49ERTYGT666aba5d7dbd3

If you wish to option out from this kind of mail, please contact us or ignore
this message.

If you face any issues, please contact us at help@discountdata.ng

(c) 2024 Discount Data. All rights reserved.

This email was sent to you as a registered member of Discount Data
[https://app.discountdata.ng]. Thank You.

Hi @Shina_Adegoke ,

Welcome to Make Community!

We have a solution for you. Please check the below images and notes.
You can extract the required details using a “Match Pattern” Module and a regex as shown below.



Mapp the cell value here.

Final Result:-

We are providing the regex below feel free to use that.

^.*?Reference\sID\sIs\s:\s#[A-Za-z0-9]+.*$

We hope this is what you are looking for.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

1 Like

Welcome to the Make community!

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

(?<=\n)(?<match>.+?(?<phone>\d[\d\s]{7,}).+Reference.+id[\w\W]+#(?<ref>\w+\b))

Proof

https://regex101.com/r/Ziu1j6/2

Important Info

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

Output


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!

1 Like

Module Export

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block
    Screenshot_2024-01-17_200117

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

View Module Export Code

JSON

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 140,
                    "module": "util:ComposeTransformer",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "value": "logo\n[https://app.discountdata.ng/assets/images/full-logo.png]https://app.discountdata.ng\n\nDiscount Data - Nigeria's topmost enterprise solution to your telecom needs.\n\n\nNOTIFICATION ALERT\n\nHi staffdd,\n\nGlo CORPORATE GIFTING 1GB - 30 Days to 08110768733 Reference ID Is :\n#202406131022Y5WSUG49ERTYGT666aba5d7dbd3\n\nIf you wish to option out from this kind of mail, please contact us or ignore\nthis message.\n\nIf you face any issues, please contact us at help@discountdata.ng\n\n(c) 2024 Discount Data. All rights reserved.\n\nThis email was sent to you as a registered member of Discount Data\n[https://app.discountdata.ng]. Thank You."
                    },
                    "metadata": {
                        "designer": {
                            "x": -2316,
                            "y": -1382
                        },
                        "restore": {},
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ]
                    }
                },
                {
                    "id": 141,
                    "module": "regexp:Parser",
                    "version": 1,
                    "parameters": {
                        "pattern": "(?<=\\n)(?<match>.+?(?<phone>\\d[\\d\\s]{7,}).+Reference.+id[\\w\\W]+#(?<ref>\\w+\\b))",
                        "global": false,
                        "sensitive": false,
                        "multiline": false,
                        "singleline": false,
                        "continueWhenNoRes": false
                    },
                    "mapper": {
                        "text": "{{140.value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": -2070,
                            "y": -1380,
                            "messages": [
                                {
                                    "category": "last",
                                    "severity": "warning",
                                    "message": "A transformer should not be the last module in the route."
                                }
                            ]
                        },
                        "restore": {
                            "parameters": {
                                "global": {
                                    "collapsed": true
                                },
                                "multiline": {
                                    "collapsed": true
                                },
                                "singleline": {
                                    "collapsed": true
                                },
                                "continueWhenNoRes": {
                                    "collapsed": true
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "pattern",
                                "type": "text",
                                "label": "Pattern",
                                "required": true
                            },
                            {
                                "name": "global",
                                "type": "boolean",
                                "label": "Global match",
                                "required": true
                            },
                            {
                                "name": "sensitive",
                                "type": "boolean",
                                "label": "Case sensitive",
                                "required": true
                            },
                            {
                                "name": "multiline",
                                "type": "boolean",
                                "label": "Multiline",
                                "required": true
                            },
                            {
                                "name": "singleline",
                                "type": "boolean",
                                "label": "Singleline",
                                "required": true
                            },
                            {
                                "name": "continueWhenNoRes",
                                "type": "boolean",
                                "label": "Continue the execution of the route even if the module finds no matches",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "text",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "interface": [
                            {
                                "type": "text",
                                "name": "match",
                                "label": "match"
                            },
                            {
                                "type": "text",
                                "name": "phone",
                                "label": "phone"
                            },
                            {
                                "type": "text",
                                "name": "ref",
                                "label": "ref"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

@Msquare_Automation @samliew Thanks so much for your assistance . Its awesome being here.

Both solutions works . But i have have other types of notification that i want to capture .

Discount Data - Nigeria's topmost enterprise solution to your telecom needs.
Notification Alert

Hi, staffdd Funded MIGHTYOLU (mightyolu2000@gmail.com) With 950 Naira. Reference ID Is : #BQDM515VC9JQWDFM

If you wish to option out from this kind of mail, please contact us or ignore this message.

If you face any issues, please contact us at help@discountdata.ng

(c) 2024 Discount Data. All rights reserved.

This email was sent to you as a registered member of Discount Data. Thank You. 

I need to capture these funding request emails .

Also i noticed something strange ,in my google sheet instead of adding the phrased informing to the bottom of the existing rows . its adding them to the top of the sheet above each existing entry . i wonder how to sort that out . Please

1 Like

This is because your sheet has no headers in cell A1.

So Google Sheets think your sheet is empty.

Next time, please provide ALL examples upfront. By excluding examples you may get incomplete or incorrect answers.

No problem, glad I could help!

1. If anyone has a new or follow-up 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!

4. Do join the unofficial Make Discord server for live chat and video assistance

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Thanks so much , and i am sorry , i am a newbie here excited about the prospects of automation with make …

Any chance I can have regex code that could cover both examples . I am sorry for the stress

1 Like