Can not update value in database

Hi,

We have an issue trying to update existing records. The idea is that when a user submits a form, it also either inserts or updates a record in a different database. When the user has no previous records the insert part works perfectly, but when there is an existing record, it wont update it at all. Any help would be much appreciated (Yes we have been through the documentation so linking that won’t help much). We have also allowed anyone to modify (insert, read, update, delete) the database, so permission should not be the issue.

(it also does create new rows to the database where the form is connected to. And since the insert part works perfectly when the user has no existing records, the database name and the field name are correct)

export function button8_click(event) {

wixData.query( "ActiveDog" ) 
     .eq( "_owner" , wixUsers.currentUser.id) 
     .find() 
     .then( (results) => { 

if (results.items.length > 0 ) {
let item = results.items[ 0 ];
item.activeDog = “update” ;
wixData.update( “myCollection” , item);
}
//if there is no existing records
else {
wixData.insert( “ActiveDog” , { “title” : ‘active’ , “activeDog” : $w( ‘#input1’ ).value,});

                } 
                 }); 

}

We also get two errors to the console:

  1. bolt-worker.js:1 Uncaught (in promise)
  2. console.js:35 Wix code SDK error: undefined/nooranurminen/profile is an unsupported url

Don’t know if these could help to figure out whats going on?