Hi,
Im looking for code that when a button is clicked it will trigger an event that goes into my dataset and clears all the information in all fields…basically resetting it to an empty dataset with the empty fields still in place.
Its for a shopping list creator…I need the user to be able to clear all to start an new list
Im playing around with this code using the bulk remove function when I click the button
“Type” , “Ingredient” , “quantity” being the field names in my dataset, but nothing happens. it doesn’t remove any data.
I am new to this so any help would be great Thanks!
export function button2_click(event) {
//Add your code for this event here:
wixData.bulkRemove( “Membersordersheet” , “Type” , “Ingredient” , “quantity” )
.then( (results) => { let removed = results.removed; // 2 let removedIds = results.removedItemIds; // see below let skipped = results.skipped; // 0
} )
. catch ( (err) => { let errorMsg = err;
} );
So…I did this and it worked great, however working with it now i realize it’s not ideal. I’ve multiple users logged on making lists so cant really have the whole dataset being deleted all the time.
I have the dataset filtered to only show information submitted by the logged in user…but now I’m stuck on a way for users to click a button to clear only their inputted data…how would i go about this please?