Help

Re: Elevate Your Slack Notifications from Airtable with Slack Blocks

1929 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Devon_Stanton
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey Airtable enthusiasts!

I've developed a script called `slackblocks-4-airtable` that might interest those of you looking to step up your Slack notification game from Airtable. This script allows you to craft well-structured and visually appealing messages seamlessly from your Airtable base to Slack. It’s designed to make your notifications more engaging and informative.

How it Works:

1. Easy Setup:
Copy and paste the script into an Airtable script automation.

Devon_Stanton_0-1696434770090.png

2. Design Your Message:
Create an array variable to contain your message, utilizing the `$.{blockType}` syntax to design your message.

3. Build and Send:
Use `$.build(message)` to assemble your message and send it via your Slack Webhook URL.

Example Usage:

Here's a snippet of how you can instantiate the `SlackBuilder` class and send a message:

// replace 'webhook_url_here' with your webhook URL
const $ = new SlackBuilder('webhook_url_here');

const slackMessage = [
$.header("This is a header message"),
$.divider(),
$.mrkdwn("You can _even_ input *Markdown* and include <github.com|links>")
];

$.build(slackMessage).send();

Get Started:

You can find the script and a detailed walkthrough on how to set it up on the GitHub repository. There’s also a section on how to test your messages using Slack's Block Kit Builder before sending them to a live channel.

I hope you find `slackblocks-4-airtable` useful for your projects. I'm open to feedback and contributions to improve the script, and I'll keep adding more as I can. Feel free to fork the project, open a pull request, or share any ideas on improving this script.

Happy messaging!

3 Replies 3
jonathanlaniado
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks for sharing. Can you maybe clarify and showcase how messages look like?

This script allows you to craft well-structured and visually appealing messages seamlessly from your Airtable base to Slack. It’s designed to make your notifications more engaging and informative.Happy messaging!

Hey Jonathan, 

Sure thing, here's the example I included in the script so that you can see the final result

Devon_Stanton_0-1696489584094.png

I've tried to make it fairly simple for the type of element you want to make i.e. $header() for a header or $.mrkdwn for markdown text and also $.image for images, some require a few extra parameters but they should come up in IntelliSense on the airtable scripts

jonathanlaniado
5 - Automation Enthusiast
5 - Automation Enthusiast

That's awesome, thanks for sharing!