Skip to main content
Best answer

How to extract message text from Slack bot alerts (e.g. Redash) when only in attachments?

  • May 15, 2025
  • 3 replies
  • 100 views

Forum|alt.badge.img

Hi all,

I'm trying to forward Slack alerts to Gmail using Zapier. We centralize alerts from various sources like Redash and GCP into Slack. Then, using Zapier, I forward the alert to a Gmail distribution list.

The setup works well except for alerts sent by the Redash bot. While most messages appear in the text or raw text field, Redash alerts have no content in those fields.

When inspecting the Slack message data in Zapier, I see that the Redash alert body is actually stored inside attachments[0].text.

However, Zapier doesn’t seem to expose this field as selectable input, even in Code or Formatter steps. So I can’t extract or use the alert content in the email body.

Is there any way to access message content inside Slack attachments[].text from a Zap triggered by “New Message Posted to Channel”?

Thanks in advance for any advice!

Best answer by Mayas

Thank you for your suggestion. Unfortunately, your approach didn’t work in my case. However, the solution turned out to be quite a basic one…

After a few attempts, I noticed that the Redash bot message finally appeared in the test data of the Slack "New Message Posted to Channel" step. Once I selected that Redash bot message as test data, the attachments field also became available in the Gmail step when inserting data.

I’m not entirely sure what triggered the Redash message to appear in the test data — previously, even searching for it didn’t show anything — but eventually it worked.

Thanks again for your help!

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

3 replies

DavidLGS
Forum|alt.badge.img+6
  • Zapier Solution Partner
  • May 15, 2025

You could try custom pills:

 

If that doesn’t work, you might have to split your Zap into paths. One for Redash and another for everything else. In the Redash branch, send a raw, empty webhook to second Zap set to trigger when it receives the webhook. You can analyze the json body received in the second zap and that text will probably be exposed either in its own field or just in the raw json body that you then need to parse out.


Forum|alt.badge.img
  • Author
  • New
  • Answer
  • May 16, 2025

Thank you for your suggestion. Unfortunately, your approach didn’t work in my case. However, the solution turned out to be quite a basic one…

After a few attempts, I noticed that the Redash bot message finally appeared in the test data of the Slack "New Message Posted to Channel" step. Once I selected that Redash bot message as test data, the attachments field also became available in the Gmail step when inserting data.

I’m not entirely sure what triggered the Redash message to appear in the test data — previously, even searching for it didn’t show anything — but eventually it worked.

Thanks again for your help!


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • May 16, 2025

That’s awesome ​@Mayas! We’re glad to hear that the issue is now resolved!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗