i have a form with dataset filtered by the currently logged in user. but if the currently logged in user has not filled out the form yet, how can i make the inputs blank?
import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
import wixData from 'wix-data'
$w.onReady(function () {
//check the current user's email using getEmail()
let user = wixUsers.currentUser;
user.getEmail()
.then( (email) => {
let userEmail = email; // "user@something.com"
} );
//autofill the email into the dataset
$w("#input3").value = userEmail;
//query the mylist dataset
wixData.query("mylist")
.eq("email")
.find()
.then( (results) => {
//if the dataset does NOT have the email, then make the inputs fields blank since this is their first time submitting
if(userEmail NOT "email"){
$w('#input1').value = undefined
$w('#input2').value = undefined
$w('#input3').value = undefined
$w('#input4').value = undefined
$w('#input5').value = undefined
$w('#input6').value = undefined
}
} )
.catch( (err) => {
let errorMsg = err;
} );
})