diff --git a/.changeset/optional-input-block-docs.md b/.changeset/optional-input-block-docs.md new file mode 100644 index 000000000..9a9c1811c --- /dev/null +++ b/.changeset/optional-input-block-docs.md @@ -0,0 +1,5 @@ +--- +"@slack/bolt": patch +--- + +Clarify how to make input blocks optional in the Bolt documentation. diff --git a/docs/english/concepts/creating-modals.md b/docs/english/concepts/creating-modals.md index fa07b137b..6a1c7b6ed 100644 --- a/docs/english/concepts/creating-modals.md +++ b/docs/english/concepts/creating-modals.md @@ -70,4 +70,23 @@ app.command('/ticket', async ({ ack, body, client, logger }) => { logger.error(error); } }); -``` \ No newline at end of file +``` + +### Making input blocks optional + +Set `optional: true` on the enclosing `input` block when users should be able to submit the view without providing a value. This setting applies to elements inside the block, including select menus such as `multi_external_select`; the element itself does not need an `optional` field. + +```javascript +{ + type: 'input', + optional: true, + label: { + type: 'plain_text', + text: 'Choose projects' + }, + element: { + type: 'multi_external_select', + action_id: 'projects' + } +} +```