Fetch Subform values through a lookup of a lookup

Fetch Subform values through a lookup of a lookup

Hi, I'm having an issue fetching the values of a subform through a lookup field through another lookup field.

The code works perfectly to show me the subform row ID, but the second I try to get any readable data, it says "Error occurred. Please contact support"

The code is the following:
fet = Schedule_Appointment [ ID == input.Job_Number ];

for each rec in fet{
for each serviceRec in rec.ServicesSubForm{
servicesData = serviceRec.Services.Tasks_to_be_Completed;
for each taskList in servicesData{
info taskList.Task ;
}
}
}


Where "Schedule_Appointment" has a subform called "ServicesSubForm". That "ServicesSubForm" has a lookup field called "Services" which is a form with a subform called "Tasks_to_be_Completed". I need the data in "Tasks_to_be_Completed".

When I do just "info taskList" there is no error, but adding the "info taskList.Task" causes the error. "Task" is the field name in the subform.



I know it's probably very confusing, but does anyone know what I'm doing wrong? Or any other ways to do this?