Copying a Single Line field into a Look up field

Copying a Single Line field into a Look up field

Hi

I am trying to copy a single line field into a Look Up filed in the following context
Module I'm adding the function to is Api Name is Attendance_Module
Single Line Field Api = Name
Look up Field Api  = Student_Name

I currently have and it is coming up with :
Failed to save the function
  • Variable 'Name' is not defined Line Number: 1
searchrecords = zoho.crm.searchRecords("Attendance_Module","(Name:equals:"+ Name +")");
if(searchrecords.size() > 0)
{

Attendance_Module = searchrecords.get(0).get("Name");
Update_Attendance_Module = zoho.crm.updateRecord("Student_Name",Attendance_Module,{"Student_Name":Attendance_Module});
info Update_Attendance_Module;
}

Any advice?

Kind regards