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 :
Microsoft Dynamics CRM (Archived)

Web Api expand for lookup name

(0) ShareShare
ReportReport
Posted on by 227

Hello, I am trying to use the new Web Api to go from an Opportunity record, get the Owner of the Opportunity and from there get the name of that Owners VP (a custom lookup field).  I am able to get the Owner's systemuser information with JavaScript and from there get the GUID of the Owner's VP (again this is a custom lookup field), but I am unable to grab the text value of the VP's name.  The VP field is called dds_reporting_vp and in the response message in my JS it is called _dds_reporting_vp_value (guid returned).

When I use this URL I successfully get data

https://[My Orgs Info]/api/data/v8.1/systemusers(8BE2A922-D78F-E411-8795-F0921C194364)?$select=_dds_reporting_vp_value

returns:

{
  "@odata.context":"box.crm.dynamics.com/.../v8.1$metadata#systemusers
(_dds_reporting_vp_value)/$entity","@odata.etag":"W/\"77942609\"",
"_dds_reporting_vp_value":"a4e13370-4960-e411-82b6-6c3be5a8de30","systemuserid":
"8be2a922-d78f-e411-8795-f0921c194364","ownerid":"8be2a922-d78f-e411-8795-f0921c194364" }

When I add an expand to try to get the fullname value:

https://[My Orgs URL]/api/data/v8.1/systemusers(8BE2A922-D78F-E411-8795-F0921C194364)
?$select=_dds_reporting_vp_value&$expand=dds_reporting_vp
--I have also used systemuserid since it is a look back to that entity

Could not find a property named 'dds_reporting_vp' on type
3051.Capture.PNG

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I got the same issue

  • Suggested answer
    ah1994 Profile Picture
    195 on at

    Hi ,

         I had the same problem before.

    dds_reporting_vp is a lookup field name. Its not the lookup id field .please check for something ends with "id" field. for example opportunityid,parentcontactid like this...

    -> Next if you want to retrieve the full name of the related entity try the following code

    &$expand=lookupid_for_related_entity($select=fullname)

    If you had the problem please do reply.i will try to help.

    Thanks and Regards,

    Aldous Huxley V

  • Suggested answer
    Sreevalli Profile Picture
    3,256 on at

    Hi,

    Could you share the error, I tried and it worked

    my Request -

    xxxxxxxxxxxxxxxxxxxx.api.crm4.dynamics.com/.../incidents(7E392284-0856-E911-A849-000D3AB0D976)$select=title,_customerid_value&$expand=customerid_contact($select=fullname,_parentcustomerid_value)

    Given Response:

    {"@odata.context":"xxxxxxxxxxxxxxxxxxxx.api.crm4.dynamics.com/.../v9.1
    /$metadata#incidents(title,_customerid_value,customerid_contact(fullname,_parentcustomerid_value))/$entity","@odata.etag":"W/\"6124687\"","title":"2132132312","_customerid_value":"bb7f72e1-543b-e911-a841-000d3ab1da01","incidentid":"7e392284-0856-e911-a849-000d3ab0d976","customerid_contact":{"@odata.etag":"W/\"4354842\"","fullname":"XXX XXXX","_parentcustomerid_value":"714c9cb7-9b3a-e911-a841-000d3ab1da01","contactid":"bb7f72e1-543b-e911-a841-000d3ab1da01"}}

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans