Hi Power Apps Developers!
I'm not able to create one Dynamics 365 Case record from Canvas Apps by Patch() or SubmitForm() functions; cause:
- there is the "Customer" polymorphic lookup field but D365 Case data don't achieve the attribute "Customer" (I remember that Customer is a grayed required field for Dynamics 365)
- there is a lot of confusion on the Community about to fill correctly a simply CDS lookup field (ex. SLA lookup, Contact lookup etc...)
here the concept Power Apps Claim form:

here my code onSelect button "Create New":
Patch(
Cases,
Defaults(Cases),
{
title: txtTitleFC.Text,
description: txtDescriptionFC.Text,
caseorigincode: Value(drpOriginFC.Selected.Value),
prioritycode: drpPriorityFC,
customer: First(colCustomerToBeAdded).colCustomerRecord
sla: First(cmbSlaFC.selected)
}
);
where:
colCustomerToBeAdded is a collection item with the record customer (Account or Contact)
cmbSlaFC is a combo box input filled by D365 SLA records data set (simply lookup field).
@fins reported the same problem at the end of this post:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Error-Using-Patch-to-Create-Record-with-Polymorphic-field/td-p/370565
I hope that someone expert will help us with a definitive solid solution to create a Case record by Power Apps and solve the Customer Polymorphic lookup.
Thanks in advance