I want to create radio buttons that are populated with items from this collection. In my editor, I added a dataset and radio buttons. I connected the radio buttons to the dataset (see image below)
I don’t know if you found an answer that didn’t use code but I was looking to do the same thing and couldn’t so wrote this, which works fine…
$w.onReady(function () {
let dataset = "#dataset2";
let radioGroup = "#radioGroup2";
$w(dataset).onReady(() => {
const totalItems = $w(dataset).getTotalCount();
$w(dataset).getItems(0,totalItems)
.then((results) => {
var index;
var options = [];
for (index = 0; index < totalItems; ++index) {
//note that "name" on the next line is the parameter taken from the dataset for both the "label" and the "value". The latter could equally be substituted for a different field in the dataset.
options = options.concat({"label": results.items[index].name, "value": results.items[index].name});
}
$w(radioGroup).options = options;
});
});
});
I am by no means a professional programmer so use it at your own discretion.