Hi everyone,
I’m trying to implement a counter in a repeater activated by a button in the repeater. I can add 1 to all the elements or just one at first element … I have been looking for information, I have read the API, but I cannot understand where the error is also because the compiler does not mark me anything.
Can you please help me and give me advice?
THANK YOU
export function iconButton1_click(event) { // my heart icon button
$w(‘#dtsg’).onReady(() => { //dataset link to the repeater
$w(“#repeater1”).forEachItem(($item, index, itemData) => { //name repeater
let vote = $w(‘#dtsg’).getCurrentItem().poll + 1; // the field in dataset with vote number
$w(‘#dtsg’).setFieldValue(“poll”, vote); // the field where saved new vote
$w(“#dtsg”).save();
});
});
}