Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack static_select avoid backend call when change

Tags:

slack-api

I have a slack modal with a static_select

{
      block_id: "my_block_id",
      type: "section",
      text: {
        type: "mrkdwn",
        text: "Please select one"
      },
      accessory: {
        type: "static_select",
        action_id: "select_type",
        placeholder: {
          type: "plain_text",
          text: "Select one"
        },
        options: self.types_options
      }
    },

When the user selects one of the option a backend call is been triggered, can I avoid that and have the call triggered on submit form button click?

like image 599
Petran Avatar asked Aug 06 '26 08:08

Petran


1 Answers

Put your static_select inside an input rather than a section.

When someone uses an interactive component in your app's modal views, the app will receive a block_actions payload.

This does not apply to components included in an input block (see below for details about those).

https://api.slack.com/surfaces/modals/using#components

Any interactive components used within input blocks will not send this block_actions payload. They are included in view_submission payloads only.

https://api.slack.com/reference/interaction-payloads/block-actions

like image 118
Nick Darvey Avatar answered Aug 08 '26 11:08

Nick Darvey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!