Formatting in Slack Messages

I saw elsewhere that Airtable-limited markdown is available for Automations (possibly only for emails? - not clear), but I can’t seem to get the markdown to work for Slack message automations.

:loudspeaker:: The Accounting base in :airtable: has been updated by 
[Record (Step 1: Trigger) | Field values | By | Name] with the following release notes:
‏‎[Record (Step 1: Trigger) | Field values | Description ]

So that the message in Slack looks like this:

:loudspeaker:: The Accounting base in :airtable: has been updated by frozenforum with the following release notes:

  1. Created a new Client Companies table
  2. Converted Client Company field to be a link to Client Companies
  3. Moved company groups to Client Companies table

But instead, the Slack message looks like this:

:loudspeaker:: The Accounting base in :airtable: has been updated by frozenforumwith the following release notes: 1. Created a new Client Companies table
2. Converted Client Company field to be a link to Client Companies
3. Moved company groups to Client Companies table

I cannot get the new line (hard return) after the colon in release notes, although it does show up in the subsequent lines of the record field.

I also cannot get a space after the Name record field, so it says [name]with.

Is this a bug or am I doing it wrong (or both!)?

I think you’re on the right trail for fixing this. I have learned that Slack’s version of markdown formatting his dependent on new line characters. How are you adding newline characters now?

I’m not sure how to do that. The only hard returns in the Slack message now are in the description field itself. The Automations window with the message seems to ignore the hard returns that I put in there.

And that’s exactly my question - how are you attempting to place hard returns into the message? I need to see specifically your approach.

I just push the return key in the Automation message window. What is the right way to do that?

I think you need to embed newline characters such as “\n”.

Hmm I tried that but unfortunately the Slack message just ends up looking like this:

:loudspeaker:: The Accounting base in :airtable: has been updated by frozenforumwith the following release notes:
\n

  1. Created a new Client Companies table
  2. Converted Client Company field to be a link to Client Companies
  3. Moved company groups to Client Companies table

For reference, my Automations message looks like this:
image

Hmmm… this works just fine for me. Do you have the “Rich Text Formatting” option turned on in your Long Text field?

p.s. You don’t need the \n line break character in this particular circumstance.

I’m old and I’m confused - when you say “The Slack message ends up looking like this …” are you referring to content pulled from Airtable and sent via script automation to Slack? And secondly, if so, are you pulling from long text fields, single line text fields, or something else entirely?

Sorry for the confusion @Bill.French! When I say “the Slack message ends up looking like this”, I mean that the formatting of the message that I see in Slack as a result of this automation looks like that.

I am pulling the Name field a collaborator field, and the Description field is a Rich Text Formatting field.

Okay, so here’s the deal (I think):

  • Airtable’s rich text field does not support a standard version of Markdown tags, but neither does Slack for that matter.
  • That said, the challenge is transforming whatever it is that Airtable stores as the description content into the format that Slack expects.

My guess is that you’ve probably stumbled upon a bug with Airtable’s Slack integration. When I said that it was working for me, what I failed to mention was that it works for me when “sending an automated email via Airtable’s automations”, not “posting to a Slack channel via Airtable’s automations”. I would email support@airtable.com about this situation, and please report back here with what they say!

This is certainly a possibility. But isn’t @egordin simply creating a custom integration using an automation plugin that pulls data from Airtable fields and pushes them into Slack without any presumption of specific formatting? Ergo - aren’t we on our own when we ask Airtable to push data into Slack via an automation plugin?

If my assessment is accurate, it seems that there are two outs for @egordin -

  1. Format the data in the Airtable fields in a way that it creates the desired formatting in Slack;
  2. Use an automation script to read the Airtable data; transform it into the desired Slack markdown format; and write to the target channel using the Slack API.

Neither of these are particularly ideal approaches, but I sort’a get it If Airtable support says -

Hey, we gave you the ability to automate messaging from Airtable to Slack; formatting nuances are your problem.

One test you might want to try -

  1. Create a long text field without rich text formatting enabled.
  2. Populate that field with a sample Slack message marked up using this markdown specification.
  3. Use your automation to push this test into Slack and see what it looks like.

If it works, you could create a formula that uses SUBSTITUTE() functions to create a Slack-ready long text field from your description field.

I’m currently building a massive reflector between a large development team and a giant Insided community (like the community we’re in right now). In the process of doing this, I have learned much about the Slack markdown spec and all of its nuances and I would not blame Airtable for a NY minute for not attempting to create a unified transformation between rich text fields in Airtable and Slack message outcomes. HTML to Slack and back requires a massive number regex transformation possibilities.

Quick update - I spoke with Airtable support and they assured me that everything should be working. I recreated the Slack message in the Automations window and the space after the name works. The hard return also works. The list isnt formatted as a Slack list, but that’s ok for my needs. Thank you everyone!

2 Likes

One more quick update for anyone’s future reference. I wanted to see how in-line links could be sent to Slack from Airtable automations, and I read that formatting guide for markdown on Slack that @Bill.French recommended. Works perfectly.

I even got Slack to show an attachment photograph from a record by creating a link with a space as the inline text. Slack sowed the photo below the message and I didn’t need to have a link that was visible. Amazing.

Adjust the text that appears as the link from the URL to something else:

<http://www.foo.com|This message *is* a link>

1 Like