Hi friends!
I am looking for a way to delete a file in my dataset, the problem is that everything I read talks about deleting the entire row and not a specific item. I've read enough and still can't find the solution. Any ideas?
Do you mean to delete using code?
If that’s what you meant -
Install the Wix Data Helpers Velo package/
Import the getAndUpdate function and use it as described in the doc.
Hi thanks for your answer! i try this for delete archive in my dataset but it dosn´t work.
in this line : item . campodeprueba = ‘’ ; say this :
Property campodeprueba does not exist in on type object
import { getAndUpdate } from '@velo/wix-data-helpers'
export function elimina_click(event) {
getAndUpdate('Empleados', 'campodeprueba', (item) => {
item.campodeprueba = '';
return item;
});
}
@firmaloizzo I believe campodeprueba is one of your fields in your collection.
try this one
export function elimina_click(event) {
getAndUpdate('Empleados', 'ITEM ID OF YOUR COLUMN YOU WANT TO UPDATE', (item) => {
item.campodeprueba = '';
return item;
});
}
Yes.
Or use:
delete item.campodeprueba;
And if you wish to query and update the results (based on parameters other than _id). Do something like:
wixData.query('collection').eq('fieldKey1', VALUE).find()
.than(r => {
const {items} = r;
if(!items.length){return;}
items.forEach(e => delete e.campodeprueba);
return wixData.bulkUpadte('collection', items);
})
@jonatandor35 Hi Its Works Tanks!