I've been using a Zap to convert an HTML message to Markdown to post in Slack. Previously, this setup worked perfectly, and the messages in Slack were formatted correctly. However, recently, the Slack messages have not been formatting correctly.
Here are the steps my Zap follows:
Convert the message from HTML to Markdown.
Post the Markdown message to Slack.
Could anyone help me figure out why the formatting might have broken recently or suggest any adjustments to fix this issue? Any insights or tips would be greatly appreciated!
Thank you!
Page 1 / 1
Hi @InfoTSCFO
For us to have more info, post screenshots showing how your Zap steps are outlined and configured in EDIT mode.
Hi there @InfoTSCFO,
Just giving a quick nudge here. Could you please send screenshots of your Zap setup? Especially the “Configure” section of the Slack action step so that we can take a closer look.
Thanks!
Hi,
I attached images of steps where text is converted from HTML to Markdown (Step_5) and where the message is sent in slack (Step_6)
Thanks for the screenshots @InfoTSCFO!
I did some digging into our notes, and it seems like Slack Markdown slightly differs from Standard Markdown, making it so using a Formatter step to convert markdown to HTML doesn't always work, especially when it comes to hyperlinks.
A Code step with Javascript can be used to convert Slack Markdown to Standard Markdown first.
A customer shared the following script that worked for them:
var slackMessage = inputData.slackMsg; const regex = /<(https?:\/\//\w-]+(?:\..\w]+)+(?:\//\w?=%&@$#\~\-_.+]+)*\/?)(?:\|((?::^>])+))?>/g; var result = slackMessage.replace(regex, ($2)); output = { result };