array to image converter [media gallery field]

I managed to make an upload button to connect to field media gallery, however when the image is sent in the database it remains as code
is there any way to make this convert to image format?

english error mensage:
" the value does not match the type of media gallery field
convert (unavailable)
clear content"

export function button50_click(event) {
let currentitem = $w("#dataset3").getCurrentItem();  //select user gallery (data)
//start upload image without description or title 
$w("#uploadButton5").startUpload($w("#uploadButton5").buttonLabel = "Uploading")
.then((uploadedFile) => {
 let uploadfileurl = uploadedFile.url;
 let items = $w("#gallery1").items;
                    items.push({
 "src": uploadfileurl,
 "description": "",
 "title": ""
});

//put the image sent to the database
$w("#gallery1").items = items;
       $w('#dataset3').setFieldValue('galeriamidia',items,currentitem);
 //save the dataset
        $w('#dataset3').save(currentitem);
//reset button label
$w("#uploadButton5").reset();
$w("#uploadButton5").buttonLabel = "Upload";
                    }
 

)}
2 Likes

fixed, a line “type” was missing

"type": "image",
"src": uploadfileurl,
 "description": "",
 "title": ""