Skip to main content
Best answer

Help With Extracting Data From Slack Messages

  • 19 July 2024
  • 6 replies
  • 50 views

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?

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

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

​​​​​​​

Userlevel 7
Badge +14

Hi @BTB 

Perhaps try using AI to extract the data points.

 

Userlevel 7
Badge +14

@BTB 

You can use multiple Formatter steps to isolate data points.

Formatter > Text > Split

 

Similar concept using Code to split text.

 

@BTB

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.

Userlevel 7
Badge +14

@BTB 

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.

@BTB

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!