Cannot edit saved submissions from connected project when ID is not matching

I have two forms, Form_1 the main form that has ID, name, age…etc. and another one Form_2 connected to the first one. When I put the ID in the Form_2, it auto-fills the other fields (name, age …).
However, the ID in the Form_2 is not required, sometimes I have to enter data without an ID. I just manually insert their details like name, gender, age, and leave the ID blank. This is a common scenario that for some people we have IDs, for others we don’t. Both forms are working without problems.

The issue comes when I try to edit a submission from Form_2 that doesn’t have an ID. When the form loads, it performs the calculation that fetches data from the Form_1, and because there’s no ID here, it returns nothing and it shows blank fields.

Form_2 has a repeat_group and I’m trying to edit one submission that has 19 people in the repeat_group. Enketo shows all 19 people with blank fields because they don’t have IDs.

I tried doing an IF statement to skip the calculation but it didn’t work.

Thank you

@Isslam, it seems like you are using the dynamic data attachment.

@Kal_Lam yes. Everything works when the ID is provided on Form_2. I need to edit submissions that don’t include IDs, for now I can’t because everything is blank when I try to edit.

@Kal_Lam any ideas?

Hi guys
I’m still stuck on this. Any help is appreciated