Upload button does not insert file into collection

I have 2 document upload buttons + submit button connected to a write-only dataset linked to my database. My upload buttons are connected to file type fields in the database via dataset and submit button click action connects to submit in dataset. However, submit does not insert the files in the database. Instead the documents are uploaded to the visitor uploads folder in media manager. Can anyone advise why the insert into database does not happen?

I suspect that you need to use setFieldValue() to set the image field of the current dataset item. Something like:

let image = $w("#image").src; // get image source URL from image element
$w("#dataset").setFieldValue("image", image); // set dataset image field

Thank you - that’s taken care of the problem!