Hi,
Note that the remove function returns a Promise . Therefore, you should use Async Await :
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();
}
}
});
$w("#dynamicDataset").refresh();
}
Good luck ![]()
Tal.