Option group object
Defines a way to group options in a menu.
The menu can be a select menu or a multi-select menu. An option_groups array can have a maximum number of 100 option groups with a maximum of 100 options.
Fields
| Field | Type | Description | Required? |
|---|---|---|---|
label | 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 | Object[] | An array of option objects that belong to this specific group. Maximum of 100 items. | Required |
Example
The option group object must be used with the select menu element or the multi-select menu element. This example shows a static select menu containing the option group object.
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":mag: Search results for *Cata*"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<fakeLink.toYourApp.com|Use Case Catalogue>*\nUse Case Catalogue for the following departments/roles..."
},
"accessory": {
"type": "static_select",
"placeholder": {
"type": "plain_text",
"emoji": true,
"text": "Manage"
},
"option_groups": [
{
"label": {
"type": "plain_text",
"text": "Group 1"
},
"options": [
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-0"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-1"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-2"
}
]
},
{
"label": {
"type": "plain_text",
"text": "Group 2"
},
"options": [
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-3"
}
]
}
]
}
}
]
}