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 / Dataverse Custom API i...
Power Apps
Unanswered

Dataverse Custom API inputparameter EntityCollection and Alternate key notworking in http request

(0) ShareShare
ReportReport
Posted on by 16

Hi, 
I'm using custom api with one parameter in type of EntityCollection and for lookup I'm using EntityReference with usage of alternate key.
example json payload

{
 "collection": [
 {
 "@odata.type": "Microsoft.Dynamics.CRM.new_itemtable",
 "new_reftableid": {
	"@odata.type": "Microsoft.Dynamics.CRM.new_reftable",
	"new_itemid": "key123"//alternatekey
 },
 }
 ],
 "reftable": {
	"@odata.type": "Microsoft.Dynamics.CRM.new_reftable",
	"new_itemid": "key123"
 }
}

And from plugin  reftable parameter is working (EntityReference, new_reftable)
Collection attribute "collection" that entityreference attribute is not present.

And if I use SDK in C#  (Microsoft.PowerPlatform.Dataverse.Client) it's working

EntityCollection collection = new EntityCollection();
   collection.Entities.Add(new Entity("new_itemtable")
   {
       ["new_reftableid"= new EntityReference("new_reftable""new_itemid""key123"),
       ["new_otherfield"= 10,
   });
 
   OrganizationRequest request = new OrganizationRequest("gas_createdeliveryorder")
   {
       Parameters =
       {
           ["deliveryorderlines"= collection,
           ["reftable"] = new EntityReference("new_reftable", "new_itemid", "key123"),
       }
   };
 
   var response = client.Execute(request);

And sdk is working on plugin I get value for "collection.new_reftableid

Any idea what's wrong in my http request body that this collection item not working?

 

I have the same question (0)
  • BartoszP Profile Picture
    16 on at

    I found out that missing data are present in Entity.RelatedEntities.
    Still, it's strange that message from SDK (this always is old soap message, even if I use UseWebapi =true), it's getting those data inside of Entity no need to check for RelatedEntities

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 739 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 268

Last 30 days Overall leaderboard