|SOLVED| Email value not saving to the collection/database. Can anyone help complete it/fix it?

Hi guys! I need some help. The email field populates but does not save to the collection. Please help. From my understanding, I need to setFieldValue. Unfortunately, everything I have tried has ended in ERROR! Using this code to restrict form submission. Thank you.

$w . onReady ( function () {
if ( wixUsers . currentUser . loggedIn ) {
let user = wixUsers . currentUser ;
console . log ( user );
user . getEmail ()
. then (( email ) => {
let userEmail = email ;
console . log ( userEmail );
$w ( “#input198” ). value = userEmail
wixData . query ( “SubmitSingleFamilyManufacHome” )
. eq ( “email” , userEmail )
. limit ( 1 )
. find ()
. then (( results ) => {
let allResults = results . totalCount ;
console . log ( allResults );
if ( allResults > 0 ) {
console . log ( “member submitted form previously” );
$w ( ‘#text520’ ). show ( ‘FadeIn’ );
}
})
})
}
})

Just needed to add the following:

$w ( ‘#dataset1’ ). setFieldValue ( ‘email’ , $w ( ‘#input198’ ). value );