Skip to main content

Notifications

Community site session details
Power Apps - Microsoft Dataverse
Answered

Dataverse Custom API Alternate key

Like (0) ShareShare
ReportReport
Posted on 20 Oct 2022 19:22:42 by 16

Hi,
Is it possible to use alternate key on custom api when input parameter is type of Entity Reference. Then in payload to custom api call instead of entity reference in form of table name and record id use, alternate key from source table.

example payload:

{
 "contactid": {
 "@odata.type": "Microsoft.Dynamics.CRM.contact",
 "customalternatekey" : "uniquevalue01"
 }
}

 

C# example call:

EntityReference contactIdKey= new EntityReference("contact", "customalternatekey", "uniquevalue01");
 OrganizationRequest request = new OrganizationRequest("new_apitest")
 {
 Parameters =
 {
 ["contactid"] = contactIdKey,
 
 }
 };

 var response = client.Execute(request);

 

Categories:
  • a33ik Profile Picture
    3,304 Most Valuable Professional on 21 Oct 2022 at 13:28:50
    Re: Dataverse Custom API Alternate key

    Thanks for the interesting discovery! Never thought to use the alternate key that way!

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on 21 Oct 2022 at 07:16:12
    Re: Dataverse Custom API Alternate key

    thanks for the confirmation!

  • Verified answer
    BartoszP Profile Picture
    16 on 21 Oct 2022 at 07:13:23
    Re: Dataverse Custom API Alternate key

    I checked it again on morning and it was issue with my plugin that give error with dictionaries, and I was almost sure it was corelated with payload data.

    So alternate key for custom API are working.

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on 20 Oct 2022 at 20:26:27
    Re: Dataverse Custom API Alternate key

    interesting question, honestly I never tried but I don't think it's possible. Did you try and got a specific error?

    EDIT: user confirmed is possible

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

#2
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

#3
CU07050602-0 Profile Picture

CU07050602-0 4

Overall leaderboard

Featured topics