filtering lookup fields

filtering lookup fields

Hi, I am having real trouble filtering a lookup field for patients according to the pharmacy branch/shop they go to. I used this code on load. However, there is some kind of error with the last line, because when I added it in, the form stopped loading when I wanted to access it and it said "error occurred on loading this application."


User_Email=zoho.loginuserid;
getShopAt = Users[Email == input.User_Email];
Shop=getShopAt.Branch_at;
Patient_List = Patient_Details[Shop == input.Shop];
Patient_Details:ui.add(Patient_List.Patient.getall());