I have a CDS based App and I am trying to fetch the results of a single row into a variable (so I don't need multiple lookups for each of the relevant fields as that may be causing performance issues).
I have 'Explicit Column Selection' turned ON. This bit me before back in November when the behaviour was changed (for existing published Apps!) such that it stopped returning fields that are only referenced as a dot property of a variable assigned via a LookUp. However, I want it turned on as in January a change was made to the CDS Appointment entity (MS deprecated some fields) that broke our Apps and the quickest fix was to turn on 'Explicit Column Selection' so the App stopped trying to fetch these never referenced, no long existing fields.
So, my issue is, I have 'Explicit Column Selection' turned ON so the fields I need are not being returned from the LookUp:
Set(
varPreInspection1,
LookUp(
'Pre Inspections',
Job.Job = varJob.Job && Appointment.Appointment = varAppointment.Appointment
)
);
To try to fix this, I thought I would use a First/Filter combination and use ShowColumns to make it clear the columns that should be returned, like so:
Set(
varPreInspection1,
First(
Filter(
ShowColumns('Pre Inspections',"dsl_job", "ds_appointment", "dsl_apillars" ),
dsl_job = varJob.Job && ds_appointment = varAppointment.Appointment
)
);
So, the first issue is I have to use the internal field names (I really hate how inconsistent the field naming is with CDS), the second issue is that PowerApps rejects any reference to a LookUp field type (Job and Appointment in this case) and says the fields do not exist.
Is this yet another limitation within CDS - ShowColumns cannot return LookUp fields?