Best answer

How to I extract the text of a new post to Slack

  • 20 February 2023
  • 8 replies
  • 975 views

Userlevel 1
Badge

Hi,

There is a trigger for a Zap which can be initiated when a new message is posted to a channel, which is exactly what I want. The problem is, the fields parsed do not appear to contain the actual text in the message. The messages are posted by a bot so always formatter the same way.

How can I get the the actual message text rather than just the meta data? Even the “Raw Text” field only contains the first line of the message, but it the subsequent line I’m interested in. 

Cheers.

icon

Best answer by swinster 22 February 2023, 23:29

View original

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

8 replies

Userlevel 7
Badge +9

Hey there, @swinster! Bummed to hear this isn’t supported at the moment. 😔

We appreciate you swinging back around to let the community know though! We’ll be sure to email you and keep this thread updated if and when that changes. 

Thanks for joining the Zapier community! 🧡

Userlevel 1
Badge

For the purposes of helping those that come along after me to figure out the same questions, this is what I received from Zapier support:

> Slack Block's are not supported in any of the Slack App triggers or actions currently but we've had previous interest so I've added your vote to the existing feature request we have open.

 

So, whilst a feature request, hopefully, there will be traction in the future (hint hint everyone). For the time being, unfortunately, I am stuck as it is unlikely that we would create something custom.

Userlevel 1
Badge

Thanks @Troy Tessalone , I have opened a ticket, so lets see what they say. 

Userlevel 7
Badge +14

@swinster 

The link about Blocks was to provide context about Blocks.

Since the data is in Blocks that may be why it’s not showing up in the Zap trigger as data to be parsed.

You can try opening a ticket with Zapier Support for further clarification if data in Blocks comes thru in Zap triggers from Slack: https://zapier.com/app/get-help

Userlevel 1
Badge

@Troy Tessalone , thanks for the suggestion. I checked out you first linked article, and I can see the “Load More” option (which TBH, I hade already done), but each message that is loaded is simply an individual post (as shown above), which contains essentially the same data fields and values (i.e. no additional text). 

I then checked out the second linked document regarding blocks, but I this seem to outline how to compose a block and define its structure. How then can you get the text within a block so that it can be parsed when the new message event fires?   

 

Userlevel 7
Badge +14

@swinster

You can try changing your trigger test data to see if those sections come as separate messages: https://help.zapier.com/hc/en-us/articles/8496310366093

 

Otherwise, the issue might be because the Bot is using Blocks to attach more info to the message.

The green section is a block, the 2 gray sections are blocks.

Learn more about Blocks: https://api.slack.com/messaging/composing/layouts

 

Userlevel 1
Badge

so, this is a sample message post by the Pendo bot into a Slack channel

I want to parse the text in the are highlighted. 

The trigger connect correctly and is set to fire when a new message is posted, but this text is simply not there, so I can’t work with it. I have captured all the data in the image below (but you can see the main “Text” field and the “Raw text” filed is the same), but let me know if you need more:

 

Userlevel 7
Badge +14

Hi @swinster 

Good question.

For us to have enough context, please post detailed screenshots of how your Zap steps are configured along with examples of the Slack messages you are trying to work with.