Variable Not Defined

Variable Not Defined

I copied the code exactly as it was stated in your help link:

https://www.zoho.com/creator/help/script/fetch-records.html#Fetch_Related

I updated it for the forms and fields in my application and I'm getting a Variable not defined error.  What am I doing wrong

if (Wanderist_Details[ID == input.Name].count() > 0) 
x = Wanderist_Details [ID == input.Name]; 
//input. refers to fields in current form 
input.Wanderist_Number = x.Wanderist_Number; 
input.Passport_Issued_by_US = x.Passport_Issued_by_US; 
input.Expiration_Date = x.Expiration_Date; 
input.Address = x.Address; 
input.T_Shirt_Size = x.T_Shirt_Size; 
}