Dear all,
I'm struggling with a patch statement towards a lookup field in dataverse. Let me try to explain my scenario.
I have following table defined in dataverse with the following relationships.
table : Inspection instruction


Further I made a gallery based on a collection.

I want to patch the entries of the collection towards the table inspection instruction in dataverse
To achieve this, i used follwing code :
Patch(
Inspections,
Defaults(Inspections),
{
Reference: gbl_InspRef,
'Internal Reference': gbl_InspIntRef,
Date: dte_DateInsp.SelectedDate,
'Executed By': drp_ExecutedByInsp.SelectedText,
Remark: txt_RemarkInsp.Text
}
);
ForAll(
col_InspInstr,
Patch(
[@'Inspection Instructions'],
Defaults([@'Inspection Instructions']),
{Reference: GUID(),
'Inspection Reference': LookUp([@Inspections],Reference in gbl_InspRef
'Instruction Reference': LookUp([@Instructions],Reference in col_InspInstr.Reference)}
)
);
The statement : "'Inspection Reference': LookUp([@Inspections],Reference in gbl_InspRef" gives me follwing error :

gbl_InspRef is a global variable defined in a previous screen and passed to this screen. (it's also used to patch into another table 'inspection')
The statement : 'Instruction Reference': LookUp([@Instructions],Reference in col_InspInstr.Reference) results in always the same record added, in this case C-VIK-026

as i should expect C-VIK-026 and C-VIK-026-E as is in my collection

What am i doing wrong.
You're help would be very appriciated
Kind regards
Steve