Update existing row in another dataset

I’m having a problem in updating some fields in the existing row in my dataset.
My submit button will update 2 datasets. Dataset 1 is working succesfuly. It just add new row. However my dataset 2 needs to filter the existing lot number to update its delivered and remaining field. Dataset 2 does not update. Please help me with my code.

this code if for updating my dataset 2 (manuEdit is my dataset2)

let delivered = $w("#qty").value;
let lotNum = $w("#dropdown2").value;
$w("#manuEdit").setFilter( wixData.filter()
.eq("title", lotNum)
) .then( () => {
console.log(lotNum);
console.log(delivered);
let currentItem = $w('#manuEdit').getCurrentItem();
console.log(currentItem);
if (currentItem.title === lotNum) {
let currentDelivered = currentItem.delivered + delivered;
let remaining = currentItem.quantity - currentDelivered;

$w("#manuEdit").setFieldValue("delivered", currentDelivered);
$w("#manuEdit").setFieldValue("remaining", remaining);
}
}

In your code, you filter, you get the current item after filtering, you set the new field values, but you don’t save() the result.

I already add

$w('#manuEdit').save();

stil not working

@mariannepenanueva Do you see the console.log() output from your code? Does it show the correct information?

Does your collection have the correct permissions?
Does your dataset have write permission?

Hi, your answer really did help. Collection permision was write only, I change it to read & write after that there’s console.log output already and it updates my dataset already. Thank you.