Why Does the Build and Send Block Kit in Slack Require a URL and Can it be Avoided?

okay … so I see that i need to use the same auth for slack. I’m not really sure what that means? That both workflows in Pipedream use the slack account already configured in pipedream (I only need one slack account for this), is that right?

i sent you the screen shot of the workflow that sends the bloc message

here’s one of hte one that is triggered to notice for an interaction event:

doesn’t that confirm that they’re both from the same auth?

Okay cool, looks like it I think. Are you’re including that action_id in the blocks definition that’s also configured in the trigger?

yes

let me confirm

Yes, it’s in the block builder step;

Hm, why are you stringifying? I don’t believe you need to, right?

Well that’s what Chatgpt told me and Pi insisted… it also says “string” after the “Action IDs” section in the trigger of the next workflow

(chatgpt said to lose the stringifying)

basically i get an error when I don’t and that’s how pi tells me to resolve it

What’s that error in the blocks code step? And what’s the error that you get if you don’t stringify?

SyntaxError

Unexpected token 'o', "[object Obj"... is not valid JSON

this is the error I get in the send block message step and when I debug, Pi says Pipedream wants it in a string

Can you paste that blocks code step here?

absolutely

export default defineComponent({
async run({ steps, $ }) {
const messageTs = steps.trigger.event.ts;

const blocks = [
  {
    "type": "section",
    "text": {
      "type": "mrkdwn",
      "text": "A new referral has been detected. Click **Search** to see more details."
    }
  },
  {
    "type": "actions",
    "elements": [
      {
        "type": "button",
        "text": {
          "type": "plain_text",
          "text": "Search"
        },
        "action_id": "search_button",
        "value": messageTs
      }
    ]
  }
];

// Convert blocks array to string
return blocks;

},
});

I just tested end to end and it worked for me, the only question I have is about the messageTs reference — is that the right reference to the actual message ts?

hmm