Option group object
Groups option objects under a heading in a select menu or multi-select menu.
| Used in | Select menu element, Multi-select menu element |
Use option_groups instead of options on a static select or multi-select menu. The menu shows each group’s label above its options.
Fields
Section titled “Fields”| Field | Type | Description | Required? |
|---|---|---|---|
label |
Text object | A plain_text text object that defines the label shown above this group of options. Maximum length for the text in this field is 75 characters. |
Required |
options |
Array of Option object | An array of option objects that belong to this group. Maximum of 100 items. | Required |
Examples
Section titled “Examples”A select menu with grouped options
Section titled “A select menu with grouped options”{ "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "Which product line is this deal for?" }, "accessory": { "type": "static_select", "action_id": "product_line", "placeholder": { "type": "plain_text", "text": "Select a product line" }, "option_groups": [ { "label": { "type": "plain_text", "text": "Software" }, "options": [ { "text": { "type": "plain_text", "text": "CRM licences" }, "value": "crm" }, { "text": { "type": "plain_text", "text": "Point of sale" }, "value": "pos" } ] }, { "label": { "type": "plain_text", "text": "Services" }, "options": [ { "text": { "type": "plain_text", "text": "Onboarding" }, "value": "onboarding" }, { "text": { "type": "plain_text", "text": "Data migration" }, "value": "migration" } ] } ] } } ]}