I need help with the python regular expression for pattern extraction via formatter.
I receive lead marketing data as Slack messages and I passing this data to Monday.com board.
I am working with the fields such as Name, Location, Email, URL, Company Name etc. In some cases I got all data in others I only have Name and URL. When I pass messages to slack in some data shifts between fields on Monday.com and needs to be manually updated.
At the moment I break message into lines/fields which means that if some fields are not available the lines would shift and some of the data will be put in wrong fields.
When I check the ‘Data In’ - I see that all fields are marked with asterisk, e.g. *Location:*, *Name:*, *Company:* and so on. I was thinking if I go with the pattern extraction instead, then maybe I can use specific expression to search for *Name*, *Location*, etc., instead of mapping it by the line number.
I am not a coder and was wondering what kind of pattern/code I put in to extract the data I need and pass it correctly to Monday.com?
Help With Extracting Data From Slack Messages
Messages come in this format:
inputs
inputs
John Doe from Microsoft *Name*: John Doe
*Title*: Driving revenue growth and channel optimization
*Company*: Microsoft
*Email*: john.doe@microsoft.com
*LinkedIn*: http://www.linkedin.com/in/john-doe
*Location*: New York, NY John Doe First identified visiting *https://mysite.com/my-page/* on *July 19, 2024 at 10:24AM EST* Connect on LinkedIn :linkedin: button More Details :globe_with_meridians: button Report Data Issue :warning: button *About http://www.microsoft.commiscrosoft>* *Website:* http://www.microsoft.com *Est. Employees:* 9.9K *Industry:* Software *Est. Revenue:* $10B
P.S.
The message above has full data, some messages don’t have full data.
I tried the :
\*Location\*:\s*(.+?)\s*First identified visiting
And:
\*Location\*:\s*([^\*]+)
But when I do a test, Data Out shows:
Output Matched
_matched
false
Hi
Perhaps try using AI to extract the data points.
- AI by Zapier - Parse Any Data from Freeform Text
- ChatGPT - Extract Structured Data
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/ee5b0e0f-924b-4ae3-89dd-f88e229cec31.png)
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/de433bb9-2e70-45c4-85f0-9e4e3435b441.png)
You can use multiple Formatter steps to isolate data points.
Formatter > Text > Split
Similar concept using Code to split text.
You can use multiple Formatter steps to isolate data points.
Formatter > Text > Split
Similar concept using Code to split text.
That is what I am using right now, but due to messages being of different length the number of lines could be different and when they are I get some of the fields messed up on monday board.
Perhaps use Paths to handle different use cases if using Formatter:
https://help.zapier.com/hc/en-us/articles/8496288555917
Custom code can be more dynamic with parsing.
AI may be the most dynamic option to parse.
Perhaps use Paths to handle different use cases if using Formatter:
https://help.zapier.com/hc/en-us/articles/8496288555917
Custom code can be more dynamic with parsing.
AI may be the most dynamic option to parse.
It worked!
Thanks a lot!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.