Auto populate record on a sub-form

Auto populate record on a sub-form

Hi Zoho Team.


Requesting for your help regarding on this issue.
The workflow that I've made supposedly will auto-populate record base on user-input of a field under a sub form however, it will only work on the 1st row entry but when I try to add new, it will pull the data from the first column but none for the 2nd & third column.

Here's the code:

Updt_records = Engineer_Profile[Engineering_Personnel == input.ENGINEERING_INFORMATION.Engineering_Personnel];

for each  rec in Updt_records
{
input.ENGINEERING_INFORMATION.Department = rec.Department;
input.ENGINEERING_INFORMATION.Designation = rec.Designation;
}