I want to set a lookup column on ThisRecord using an automated low code plugin. Say I select the Student table and I want to set the teacher column (which is a lookup to Teacher table) for ThisRecord to simply be the first teacher on the Teachers table . From a canvas app, I might have this code:
Set('Main Teacher', First(Teachers))
But when I put that in the plug-in I get an error that "This record cannot be copied. Instead, create an inline record using {...} notation to copy the individual fields desired." with the First function underlined in red.
I tried their suggestion by recreating the full record inside {...} but then was getting error "Invalid argument type (Record). Expecting a Record value instead.".
I also tried to use the Relate function in Power Fx to set the lookup but even though it's not listed on the Formulas not currently supported with low code plug-ins, I get the error "'Relate' is a recognized but not supported function." .
How do I set/patch a column of type lookup on ThisRecord?