Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Cannot Find Foreign Key in API

Posted on by Microsoft Employee

Hello,

I have been working with a MSD API and have been able to pull all the fields I need from one table. However, there is one field that I need that has what I believe to be a foreign key pointing to a different table. The field name in the table is "_ownerid_value" and the value is a long list of numbers and letters like this: "D32093JK-29S7-EJC8-LS9F-43927FJS64K8". So what I was expecting to find in the table was the actual owner value. However, I would assume the owner value is being stored in another table and this is a foreign key pointing to that location in some way.

I have about 280 tables to look through and have searched for a week or two now. I thought someone might have run into something similar before?

Methods that I have used to find the corresponding value:
1) Ctrl+F in all the JSON that comes back using the long foreign key.

2) In the live application in the browser, I have opened the dev tools and actually found an attributes called "rawlookupitemid" and "oid" whose values are the long, foreign key value! So my assumption is the foreign key in coming into the client from the API, and the client is running a function somewhere that takes the foreign key and returns the corresponding value or makes a subsequent request with the foreign key to the API to get the corresponding value. However, there is no indication in the network tab of the dev tools that a subsequent API call is being made, which makes me think it is logic being executed by the client.


Thanks in advance and happy coding!

  • Suggested answer
    TylerS.Dev Profile Picture
    TylerS.Dev 725 on at
    RE: Cannot Find Foreign Key in API

    ownerid is an entity reference that points to user, if I recall correctly, the entity is call systemuser in API.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans