I’m displaying a CheckBoxList in a popup during an automation script. All the checkboxes are always unchecked(“false”) by default. Is there a way to flip this so that they are all checked(“true”) when the popup is shown (and the user then gets to deselect items)?
Robin Becker [DevOps Advocate] Selected answer as best 7th February 2023
You can define the checkboxes that need to be checked in the InitialValue property, ;-separated. So in your case you can set InitialValue to the following to check them all by default:
uiBlock.InitialValue = String.Join(‘;’, myCheckboxItems)
See the first remark on the InitialValue documentation.
Robin Becker [DevOps Advocate] Posted new comment 7th February 2023
Perfect, thank you!
An addition for those who like me create checkboxes with a rawValue and a displayValue: the array in the Join should be an array of the raw values.