@peter.letkeman i think you can do both!
there is checkboxGroup1.selectedItems and checkboxGroup1.setValue([1, 2])
checkboxGroup1.selectedItems
checkboxGroup1.setValue([1, 2])