Hi folks,
I’m wondering if there is a simpler solution to allow me to update multiple items in a database using bulkUpdate but not requiring to add each field key to stop the data that’s not included in the update being deleted
I have a CRM which I’m using to assign staff to a particular trip, this means there may be 5 items, populated in a repeater.
I want to update the guide name field only. I can get all the data to update but the code is so long with there being 35 fields in the database.
Just wondering if there is a better solution?
function staffAssign() {
let arr = [];
////// other query code
$w('#applyBtn').onClick(() => {
let staffId = $w('#staffMbrDrpDwn').value;
let toUpdate = {
"_id": itemData._id,
"guideName": staffId
}
arr.push(toUpdate)
wixData.bulkUpdate("CourseAvailability", arr ).then((results) => {
success("Staff member added!");
});
});
}
Thanks as always!