Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to get a field value based on a lookup value?

Posted on by 190

Hi, I have a user's name lookup value in the main form that looks up to a custom user table.  So I know how to get the lookup value using javascript, but how can I get another field (user's email) using the user's name for that same record using javascript?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to get a field value based on a lookup value?

    I recommend using Xrm.WebApi, the second link I provided. If you want to generate the "stub" code that you will use after - use DRB, third link.

  • Suggested answer
    bp3378 Profile Picture
    bp3378 190 on at
    RE: How to get a field value based on a lookup value?

    Hi andrew butenko thanks for the reply.  I have been using XMLHttpRequest(), which should I be using instead?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to get a field value based on a lookup value?

    Hello,

    You will have to combine the following articles:

    1. www.adyatantech.com/.../how-to-get-and-set-lookup-field-values-using-javascript - getting of the id from the lookup field placed on the form.

    2. learn.microsoft.com/.../retrieverecord - querying the record information based on the record logical name and id.

    3. The easiest way to pre-cook your query is to use Dataverse Rest Builder - github.com/.../DRB

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

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

Product updates

Dynamics 365 release plans