Hello everyone,
I am trying to create a counter for whenever I submit a form on my dynamic page (that has fields drawing from my dynamic page). I want the number to correlate with each dynamic entry and display every time someone tired to submit a form to know how many have been submitted with that particular text.
I have used the following code.
export function button1_click(event) {
wixData.query(“#dynamicDataset”).find().then((result) => {
let answersitem = result.items[0]; //item with values
let id = answersitem._id;
answersitem.noc++;
wixData.update(“#dynamicDataset”, answersitem).then(() => {
$w(“#dynamicDataset”).refresh();
});
});
}
It does produce a count every time I submit a form… but it sends it to the top of the dynamic list, rather than matching it up with that particular dynamic entry. Can anyone help me with that?