Text Parser - losing my mind!

I am having issues with text parser. I am reading information from a slack message - company name, website and objectives and want to save them as variables to use in subsequent modules.

However, nothing is progressing beyond the Text Parser.

The regexp extractor generates 3 variables that I can see in subsequent modules - client (company name), website and objectives - but nothing is being parsed and the scenario stops at the text parser.

image

Any help greatfully received!

Company:\s*(?.)\nWebsite:\s(?https?://\S+)\nObjectives:\s*(?[\s\S]*)

blueprint (3).json (83.0 KB)

Input bundle for text parser:
[
{
“text”: “Company: Client Limited\nWebsite: http://www.client.co.uk|www.client.co.uk\nObjective: to help secure an objective for the Company’s shareholders. We are discussing a simple sale, and helping them achieve a sale, as well as consolidating with other similar entities initially to provide a platform for investment by a third party to enable growth of a large group”
}
]

Output bundle:

Hi @Matthew_Parry-Hann can you share screen shots from first slack module,

also try this in text parser :

Company:\s*(?<company>.+)\nWebsite:\s*(?<website>https?:\/\/\S+)\nObjective:\s*(?<objective>[\s\S]*)

let me know if you need help

Thank you, please see attached.

[
{
“user”: “U065MAD2JPP”,
“type”: “message”,
“ts”: “1720176750.478739”,
“client_msg_id”: “9301f4ff-aed4-4a96-8ffd-75b30cf9ea0f”,
“text”: “Company: Client Limited\nWebsite: http://www.client.co.uk|www.client.co.uk\nObjective: to help secure an objective for the Company’s shareholders. We are discussing a simple sale, and helping them achieve a sale, as well as consolidating with other similar entities initially to provide a platform for investment by a third party to enable growth of a large group”,
“team”: “T066D7XS1A4”,
“blocks”: [
{
“type”: “rich_text”,
“block_id”: “ubpCo”,
“elements”: [
{
“type”: “rich_text_section”,
“elements”: [
{
“type”: “text”,
“text”: "Company: Client Limited\nWebsite: "
},
{
“type”: “link”,
“url”: “http://www.client.co.uk”,
“text”: “www.client.co.uk
},
{
“type”: “text”,
“text”: “\nObjective: to help secure an objective for the Company’s shareholders. We are discussing a simple sale, and helping them achieve a sale, as well as consolidating with other similar entities initially to provide a platform for investment by a third party to enable growth of a large group”
}
]
}
]
}
],
“date”: “2024-07-05T10:52:30.000Z”
}
]

@Matthew_Parry-Hann try this and let me know


Company:\s*(?<company>.+)\nWebsite:\s*(?<website>https?:\/\/\S+)\nObjective:\s*(?<objective>[\s\S]*)

I think you have added " objectives " but it is for " objective* "

Thank you.

It is still not outputting anything (for any of the variables).

The output bundle is still blank.

@Matthew_Parry-Hann

If you need to extract specific data you can create a variable and add certain points to get the data. Or you can also add array aggregator and map from previous module.

This is why this is blowing my mind - it just won’t parse anything out of the text parser.

I have a module setting variables, but there is no data going from the text parser module.

(I really appreciate the help!! thank you!)

Welcome to the Make community!

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

Company:\s*(?<company>.+)\nWebsite:\s*<?(?<website>https?:\/\/[^|]+?)(?:\|.+)?>?\nObjective:\s*(?<objective>[\s\S]*)

Proof

https://regex101.com/r/Ka4NFT

Important Info

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

Screenshot

Screenshot_2024-07-05_210711

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!

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.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 91,
                    "module": "regexp:Parser",
                    "version": 1,
                    "parameters": {
                        "pattern": "Company:\\s*(?<company>.+)\\nWebsite:\\s*<?(?<website>https?:\\/\\/[^|]+?)(?:\\|.+)>?\\nObjective:\\s*(?<objective>[\\s\\S]*)",
                        "global": false,
                        "sensitive": true,
                        "multiline": false,
                        "singleline": false,
                        "continueWhenNoRes": false
                    },
                    "mapper": {
                        "text": "{{90.value}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 226,
                            "y": -1654,
                            "messages": [
                                {
                                    "category": "last",
                                    "severity": "warning",
                                    "message": "A transformer should not be the last module in the route."
                                }
                            ]
                        },
                        "restore": {
                            "parameters": {
                                "sensitive": {
                                    "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": "company",
                                "label": "company"
                            },
                            {
                                "type": "text",
                                "name": "website",
                                "label": "website"
                            },
                            {
                                "type": "text",
                                "name": "objective",
                                "label": "objective"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

samliewrequest private consultation

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

3 Likes

Thank you.

I am not entirely sure why that works and mine didn’t, but it does work!

1 Like

Please try to use this in the text parser module :

Company:\s*(?<company>.+)\nWebsite:\s*(?<website>https?:\/\/\S+)\nObjective:\s*(?<objective>[\s\S]*)

in your previous version you spelled objective wrong (added a extra ‘s’ in the end)

try this and let me know

No problem, glad I could help!

1. If anyone has 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!

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!