web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create one case record...
Power Apps
Unanswered

Create one case record from Canvas App into Dynamics 365 Customer Service

(0) ShareShare
ReportReport
Posted on by 230

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:

FormPA.png

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

 

I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @David_Pezzoli 

    This is well beyond my level of expertise but on searching regarding the issue I found the link below.  Perhaps it will help. https://pavankumargarlapati.wordpress.com/2019/08/06/embedded-canvas-app-how-to-get-the-selected-polymorphic-lookup-field-value/ 

  • David Pezzoli Profile Picture
    230 on at

    @Drrickryp  Unfortunately it does not answer the problem or solve it: your link explain a contact example by Owner inside Contact form, not Case form...

    Create a Case from a standalone Power Apps is my difficulty.

     

    Thanks anyway for your trying!

  • Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at

    Hi @David_Pezzoli 

     

    I've tried to do the same thing with a Canvas Power App and gave up in the end.  My gut feeling is that it is not supported currently.  

     

    What I have done instead is create a Power Automate flow to create the Case record instead.  The Canvas App calls the flow, the flow creates the Case in CDS and then the flow returns the Case ID back to Power Apps to do what you want with it.  

     

    This isn't as elegant as it could be but it works for me.

     

    The alternative is to raise a support case with Microsoft and get the official word on whether this is supported or not.

     

    -----
     
    If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

  • David Pezzoli Profile Picture
    230 on at

    @HSheild ,

    thank you for your feedback, this issue is a sad gap for the Power Apps features. So this prove that the tool is still young: not being able to create a Case CDS record by Patch .... sigh... is disheartening!

     

    Before choosing your reply like "Accept as Solution" I wait a few days if someone else has other opinions about this Microsoft gap.

     

    Thank you so much!

    David

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard