Populating radio buttons from dataset

I have a collection with the following fields:

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)

But when I preview my page, the options don’t show:

Here’s the kicker… I can add a dropdown, link it to the same dataset, and see the list of options. Any help would be appreciated!

Hello.

Please reach out to Wix Customer Care . They will be of great help. This forum is only for code related issues and discussions.

Good luck!

Hi,

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.

Warm regards!