Apologies if this has already been discussed. I am looking to create a set of check box's that (when selected) store the text value (associated with that check box) in a single collection text field.
So for example, if a user selects multiple check box options (shown below), I would like the selected values to populate in a collection via a single text field.
Hi Eric,
To begin, make sure to add the required checkboxes and set their text value (By clicking the checkbox > Set Value)
Now you will be able to read this value using script and do something with the information.
export function submitButton_click() {
let resultArr = [];
if ($w("#cheeseBox").checked) {resultArr.push($w("#cheeseBox").value); }
if ($w("#sauceBox").checked) {resultArr.push($w("#sauceBox").value); }
if ($w("#ketchupBox").checked) {resultArr.push($w("#ketchupBox").value); }
//Do something with 'resultArr'
$w("#resultBox").value = JSON.stringify(resultArr);
}