The Field Name is “Student Email Address” and the field key is “studentEmailAddress”. Both give me 0 entries when I try to fetch.

import wixLocation from ‘wix-location’ ;
import wixUsers from ‘wix-users’ ;
import wixData from ‘wix-data’ ;
export function button9_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
let user = wixUsers.currentUser;
// let query = wixData.query(“Files”);
if (user){
user.getEmail()
.then( (email) => {
let userEmail = email; // “user@something.com”
return userEmail;
} )
.then( (userEmail) => {
wixData.query( "Files" )
.eq( "studentEmailAddress" , userEmail)
.find()
.then( (results) => {
console.log(results.totalCount);
} );
} );
}
}
