Split Button - programmatically select a specific index/item

I have a SplitButton, mapped to a data structure. I wish I can programmatically decide which item to select.

Something like button.setSelectedIndex(3) or button.setSelectedLabel("Fourth Item") or button.setSelectedItem({existingObject})

Say I have a split button where the labels are "Label1" and "Label2" ... I also tried to use button.setValue("Label2") (like I'd do for a List) but nothing happens

up :up:

I can't believe I'm the only one here that need to be able to control which item of the split button is selected

Thanks for flagging! This is a request that we are tracking, but I don't believe it's on our immediate roadmap yet

For the time being, I'd recommend controlling the selected index with a variable as the default value: