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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Web API Request - Create contact and Case in one request

(0) ShareShare
ReportReport
Posted on by 10

Hi All,

I am trying to create contact and case in one web api request using the following link

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/create-entity-web-api#create-related-table-rows-in-one-operation

Following is my code 

{
"casetypecode":2
title":"Test Case Web aPI",
"customerid_contact"  :{
"firstname""Test Contact with Case with Note"
"lastname""Web APi Call",  
"emailaddress1""abc@abc.com"
"telephone1""231497979"
}
}
However I am getting following error : 
"You should specify a contact or account."
Any help in this regard highly appreciated.
Thanks
I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I tried different options and nothing worked fine for me. It might be some specifics around customerid field. If your task is to create a set of records in one call I would recommend creating an action, exposing parameters on it for all of your inputs and sequentially creating Contact and Related case. Once that is done you can create both of those records in one call.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hello,

    I found that 'customerid_contact' is a collection-valued navigation property

    Associating entities this way using a collection-valued navigation property is not supported by the Web API.

    Try this with primarycontactid

    {

    "casetypecode":2,

    title":"Test Case Web aPI",

    "primarycontactid"  :{

    "firstname": "Test Contact with Case with Note",

    "lastname": "Web APi Call",  

    "emailaddress1": "abc@abc.com",

    "telephone1": "231497979"

    }

    }

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Can you first create contact and then case as below

    {

    "first name": "Test",

    "lastname": "Last",

    "emailaddress1": "123@1.com",

    "telephone1": "123456",

    "incident_customer_contacts":

    [

    {

    "casetypecode": 2,

    "title": "case title"

    }

    ]

    }

  • MJain Profile Picture
    10 on at

    Thank you for looking into it Bipin ,

    I tried it other way as well and in both the situations I am getting the same error message. If you are able to create both ?

    Thanks

  • MJain Profile Picture
    10 on at

    Thanks Naveen , please look at following url :

    nebulaaitsolutions.com/.../

    They have already done with Contact and Opportunities , so why can't it work for Contact and Case.

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans