Hi,
Check out this function:
export function cleanButtonOnClick(event, $w) {
$w("#dynamicDataset").onReady(async() => {
if ($w("#dynamicDataset").getCurrentItem()) {
await $w("#dynamicDataset").remove();
while ($w("#dynamicDataset").hasNext()) {
await $w("#dynamicDataset").next();
await $w("#dynamicDataset").remove();
}
}
});
}
Just connect the dataset to the wanted collection.
Roi.