bolt-js: Cannot display multi static select menu with initial options from different option groups
Description
I’m trying to load a multi static select menu with some pre-loaded initial options. I’m able to successful display the menu with the option groups and corresponding options.
However, I’m not able to preselect initial options if – and only if – the initial options belong to different option groups. Everything works fine if there’s only one initial selected option OR if the initial selected options are part of the same option group. Here’s the Block I’m working on;
{
type: 'input',
block_id: 'interests_select_block',
label: {
type: 'plain_text',
text: 'Label here',
},
element: {
type: 'multi_static_select',
action_id: 'my-action-id',
placeholder: {
type: 'plain_text',
text: 'Select one or more interests...',
},
option_groups: [
{
label: {
type: 'plain_text',
text: 'DOMESTIC',
},
options: [
{
text: {
text: 'Baking',
type: 'plain_text',
},
value: '2',
},
],
},
{
label: {
type: 'plain_text',
text: 'OUTDOOR_RECREATION',
},
options: [
{
text: {
text: 'Hiking',
type: 'plain_text',
},
value: '1',
},
{
text: {
text: 'Cycling',
type: 'plain_text',
},
value: '3',
},
],
},
],
initial_options: [
{
text: {
text: 'Hiking',
type: 'plain_text',
},
value: '1',
},
{
text: {
text: 'Baking',
type: 'plain_text',
},
value: '2',
},
],
},
}
This example fails seemingly because “Hiking” and “Baking” are part of different options groups. Loading the input element fails with a slack_webapi_platform_error
of invalid_arguments
.
Loading the same element with initial options of “Hiking” and “Cycling” works just fine – they are part of the same options group.
Any workarounds or help working through this bug would be greatly appreciated.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- example code related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.11.3
node version: 18.0.0
OS version(s): macOS Monterrey v. 12.4
Steps to reproduce:
- Create a multi-select static menu with options in options group
- Set
initial_options
to be an array ofPlainTextOptions
that are part of different options groups
Expected result:
The menu should load with options pre-selected across different options groups.
Actual result:
An invalid_arguments
error is thrown.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 21 (10 by maintainers)
@mjcbfl @nosregor @chasek-hpe @jam-fran @JonParsons11350 - The fix for this is live. You should be able to see now that a block kit multiselect with initial options from multiple options groups passes validation in Block Kit Builder.
@filmaj I am providing the updated
view
object,view_id
and thehash
parameter to theviews.update
APIHello!
Also throwing my qualms in the ring. I have banged my head against the wall with this one for the last day or so. I did away with options groups for now as a workaround. Any update would be appreciated!
Thanks!
@chasek-hpe - Thanks for the bump, I’ve just re-raised this bug to the relevant internal team.
@nikhiltadikonda I can confirm / reproduce the issue. I have filed this in #1920 as a separate issue. I will close this issue down as the original problem has been resolved, but please follow me in #1920 to continue working on this new problem you are experiencing.
@mjcbfl @nosregor @sperezpedetti @chasek-hpe @jam-fran @JonParsons11350 - The team is working on a fix for this, should ship soon and I will update when the behavior can be expected to be updated 🙇♀️
@JonParsons11350 - Reacting on posts is a good way as well, but messages and issues appear directly in our Slack Github issues triage feeds, so we’re more likely to pick up on these.
Since this issue is also a product issue that falls outside of our Bolt JS / SDK , I’d also recommend sending feedback via the general https://my.slack.com/help/requests/new
This bug is also affecting me, would love to see it fixed soon, thanks! ( Side note: what’s the best way to communicate this without posting a new comment? )
Thanks @mjcbfl and everyone else for keeping the qualms coming and for bumping this issue. The dev community feedback helps us immensely when we bring pain points to internal teams. @nosregor at the moment since I haven’t seen it added to the roadmap yet to fix, so best to continue with any workarounds shared by others / different logic.
I am sorry for the poor experience here. I have raised the issue, and intend to be persistently annoying in re-raising while it’s still an open one.
Hi, has there been any progress on this issue (setting initial options from different option groups) ?
Our slack app also relies on this. In our use case, our multi static select menu are skills distributed into 4 groups, they require some pre-loaded initial options from skills in different groups.
@jam-fran have you been able to find a work around by any chance?
A heads up if there is being worked on would be nice to know so that if a solution is not foreseeable I know that I need to work on a different logic.
Thanks in advance.
I was just about to submit a bug for this. 😆
Gotcha - that’s a pretty interesting use case, and now I totally see why you’d be wanting to keep those option groups.
I’ve submitted that behavior to the Block Kit team as a bug. For the time being, the only way I can see to work around this error state is to limit the initial options.
Thanks so much for the quick reply, Sarah.
In case it’s helpful, my use case involves asking users to select “Areas of Expertise” and pick from a list of about 200 options organized across 7-8 option group categories. The options aren’t necessarily things you’d think of yourself, so a free text input wouldn’t really work. The “initial options” would be the options they’ve previously picked for their profile, so it would have to be accurate. Unfortunately I can’t get rid of the option groups, since it seems the option limit of 100 items (without grouping) would make that impossible.
Please keep me posted if you hear any updates from your team. Thanks again!