Custom Sign up - Pass data to the second collection not working

I would like to ask for your help with this issue we have for Velo.

Basically, we are trying to connect our Custom Signup Form to a second collection called RegistrationForm so we can get their Membership Type.

Here is the code we use on Custom Sign up.


import wixData from ‘wix-data’ ;
$w . onReady ( function () {

    $w ( '#registrationForm1' ). onWixFormSubmitted (( event ) => { 
        **let**  toInsert  = { 
                "title" :  $w ( '#input2' ). value , 
                "firstName" :  $w ( '#input4' ). value , 
                "lastName" :  $w ( '#input3' ). value , 
                "membershipType" :  $w ( '#dropdown1' ). value  
                } 
                wixData . insert ( 'RegistrationForm' ,  toInsert ) 
                . then (( result )=>{ 
                **let**  item  =  result ; 
                console . log ( item +  "Table Updated" ); 
                }) 
                 . **catch** ( ( err ) => { 
                    **let**  errorMsg  =  err ;   //"The user closed the forgot password dialog" 
                    console . log ( errorMsg ) 
                    }) 
    }); 

});


If we preview the site and test it, the data on the signup form passes to the sandbox mode of the second collection which means it is working. However, it we do it on the live site version it won’t work.

Thank you for your help!

Already checked your DATABASE-PERMISSIONS?
Since you are working with wix-data, that means you access your database, you have to make sure, that you have setted-up the right DB-PERMISSIONs.