Regarding WixData Query

I have attendance database where it has field like “attendance date” and “In time” and "email. I am populating from Mobile and manual upload.

Now I need a query which pulls the attendance date (from the date picker) of the employee applying for leave where it check for his “email” and the FIRST “In time” and display in the Input element.

Please find below the code that I have done but its not working. Please help me out whether I am doing right??

export function validatetest_click(event, $w) {
let email = $w(“#email”).value;
const newdate = new Date($w(“#date”).value);

wixData.query('LM_Attendance') 
	.eq("at_email", email) 
	.ascending("at_in") 
	.find() 
	.then((result) => { 
				let firstItem = result.items[0]; 
				let items = result.items[0]; 
				let Id = firstItem._id; 
				let createddate = firstItem._createdDate; 
				let updatedDate = firstItem._updatedDate; 
				let owner = firstItem._owner; 
				let title = firstItem.title; 
				let at_email= firstItem.at_email; 
				let at_date = firstItem.at_date; 
				let at_in = firstItem.at_in; 
				let at_out = firstItem.at_out; 
				let at_actual = firstItem.at_actual; 
				let at_regfullday = firstItem.at_regfullday; 
				let at_regtime = firstItem.at_regtime; 
				let empId = firstItem.empId; 
				let at_type = firstItem.at_type; 
				let at_latitude = firstItem.at_latitude; 
				let at_longitude = firstItem.at_longitude; 
				let at_reason = firstItem.at_reason; 
				let at_agenda = firstItem.at_agenda; 
				let at_outcome = firstItem.at_outcome; 
				let at_remarks = firstItem.at_remarks; 
				let at_clientname = firstItem.at_clientname; 
				let at_mobile = firstItem.at_mobile; 
				
				$w("#timein").value = at_in; 
	return items; 
	}); 

}

Hi,

Can you specify what is not working?
Using console logs see if you get any results back from the query.
Also make sure that there are no console errors (CMD + ALT + I in mac or CTRL + I in windows)