Show only ticked tag elements from the Database

import wixData from ‘wix-data’ ;

$w.onReady( function dynamicDataset_ready () {
$w( “#dynamicDataset” ).onReady(() => {
let item = $w( “#dynamicDataset” ).getCurrentItem;
// substitute your field name storing the tags
let chosenValues = item.klimatisierung;
let newOptions = buildOptions(chosenValues);
$w( “#checkboxGroup3” ).options = newOptions;
// if you want them all checked?
let indices = buildSelectedIndices(chosenValues);
$w( “#checkboxGroup3” ).selectedIndices = indices;
});
});

function buildOptions(chosenValues) {
return chosenValues.map((curr) => {
return { label: curr.toString(), value: curr };
});
}

function buildSelectedIndices(chosenValues) {
let selIndices = ;
for ( var i = 0 ; i < chosenValues.length; i++) {
selIndices.push(i);
}
return selIndices;
}

export function dynamicDataset_ready() {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
}

I have also tried this