Slack Blocks Issue

I can’t send a Slack block to a channel.

I built a block in the Slack blocks editor, which works fine there. And I can send a simple message to Slack if I put the data into the ‘message’ field. But sending data via a block continually throws this error:

Error
“Error: Either Message or Block Kit blocks must be provided\n at /root/common/node_modules/.bun/@[email protected]/node_modules/@activepieces/piece-slack/src/lib/actions/send-message-action.js:56:23\n at Generator.next ()\n at /root/common/node_modules/.bun/[email protected]/node_modules/tslib/tslib.js:169:75\n at new Promise ()\n at Object.__awaiter (/root/common/node_modules/.bun/[email protected]/node_modules/tslib/tslib.js:165:16)\n at run (/root/common/node_modules/.bun/@[email protected]/node_modules/@activepieces/piece-slack/src/lib/actions/send-message-action.js:52:24)\n at /root/common/main.js:308:3593\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async tryCatch (/root/common/main.js:231:69907)\n at async Object.tryCatchAndThrowOnEngineError (/root/common/main.js:231:134926)”

The actual block I am trying to use is below, but it doesn’t matter. I even tried copying one of Slack’s default block templates. Same issue. Even without data in it, the block still fails to send.

I tried reconnecting my Slack account, removing the piece from my flow and re-adding it… nothing. I found two other related items in the Community threads, both from a couple years ago. But no solutions on either one.

Any ideas?

Thanks!

Block Format
{
“blocks”: [
{
“type”: “header”,
“text”: {
“type”: “plain_text”,
“text”: “:telephone_receiver: New Call”
}
},
{
“type”: “section”,
“fields”: [
{
“type”: “mrkdwn”,
“text”: “Date:\n{{step_7[‘result’]}}”
},
{
“type”: “mrkdwn”,
“text”: “Time:\n{{step_8[‘result’]}}”
},
{
“type”: “mrkdwn”,
“text”: “Phone:\n{{step_6[1]}}”
},
{
“type”: “mrkdwn”,
“text”: “Caller ID:\n{{trigger[‘body’][‘CallerId’]}}”
}
]
},
{
“type”: “divider”
},
{
“type”: “section”,
“text”: {
“type”: “mrkdwn”,
“text”: “Message:\n{{trigger[‘body’][‘TranscriptionText’]}}”
}
},
{
“type”: “divider”
}
]
}

Related Threads

I figured this out! If you’re having trouble sending block messages to Slack, it’s because ActivePieces wraps whatever you put into the box with the { “blocks”: automatically. So, copying/pasting out of the block builder throws an error because it’s double-wrapping the content.

So, whatever you get out of block builder, you need to remove the opening { “blocks”: and the closing }.

That’s why the block box in the flow has the in it before you begin!!

Whew. A little note under the box would be SUPER helpful!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.