Skip to main content
Best answer

Help With Extracting Data From Slack Messages


  • New
  • 3 replies

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?

Best answer by Troy Tessalone

Hi @BTB 

Perhaps try using AI to extract the data points.

 

View original
Did this topic help you find an answer to your question?
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

  • Author
  • New
  • 3 replies
  • July 19, 2024

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

​​​​​​​


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31349 replies
  • Answer
  • July 19, 2024

Hi @BTB 

Perhaps try using AI to extract the data points.

 


Troy Tessalone
Forum|alt.badge.img+14

@BTB 

You can use multiple Formatter steps to isolate data points.

Formatter > Text > Split

 

Similar concept using Code to split text.

 


  • Author
  • New
  • 3 replies
  • July 19, 2024
Troy Tessalone wrote:

@BTB

You can use multiple Formatter steps to isolate data points.

Formatter > Text > Split

 

Similar concept using Code to split text.

https://community.zapier.com/featured-articles-65/how-to-parse-data-with-javascript-code-step-using-split-14133

 

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.


Troy Tessalone
Forum|alt.badge.img+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.


  • Author
  • New
  • 3 replies
  • July 19, 2024
Troy Tessalone wrote:

@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!