@financialacademyca it can be many thing.
-
Make sure you’re logged in
-
Make sure your email appears in the collection (without extra spaces).
-
Check your collection permission.
-
Sync sandbox with live site.
-
Also it’s a better practice to chain promises and not to net them so:
import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
import wixData from 'wix-data';
export function button9_click(event) {
let user = wixUsers.currentUser;
if(user){
user.getEmail()
.then(email => {
return wixData.query("Files")
.eq("studentEmailAddress", email)
.find();
})
. .then( (results) => {
console.log(results.totalCount);
} );
}
}