Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to show a different column in a lookup field instead of the primary name column?

(0) ShareShare
ReportReport
Posted on by 190

I have two related tables:  Requests and a custom users table.   It's a N:1 relationship. In the custom user table I have the user's full name as the primary name column.  I also have the email as another column.  

In the Requests form, I have two lookups to the same custom user table:  Requester and Requester email.  The user manually selects the Requester, then I have a javascript webresource that uses

XMLHttpRequest() to use the Requester value to select the email, and set the value to this Requester email field.  But the field still shows as the Requester instead, even though I am still able to get this email field to do something else with it and it works.  But I just want to know how to get it to show the email column instead of the primary name.  Thanks. 
  • jdalske Profile Picture
    jdalske 536 on at
    RE: How to show a different column in a lookup field instead of the primary name column?

    I think I got it without JS.  I just mapped the two fields in 1:N relationship:

    subject - Lead entity

    originatingtopic (text field) - Opportunity entity

  • jdalske Profile Picture
    jdalske 536 on at
    RE: How to show a different column in a lookup field instead of the primary name column?

    I am attempting to do this with the Lead Topic field so that it displays in the connected Opportunity.  If I use a lookup it pulls in NoName because why on earth would Contact be the primary field (that makes no sense and we don't even use that field).  Topic is our only required field.  I am no JS expert.  If you have any ideas on what JS I can put in my "Originating Lead" field on the Opportunity to show the topic of the Lead that would be most helpful.  Thank you in advance.

  • Verified answer
    Steve Zhao2 Profile Picture
    Steve Zhao2 on at
    RE: How to show a different column in a lookup field instead of the primary name column?

    Hi bp3378,

    Andrew Butenko is correct. Lookup field displays the primary field value. This is by design and there is no OOB way to change this behavior. Although, you could use JS to modify the display name and the display name would not save into dataverse. However, it's not recommended to do like this.

    So, Andrew Butenko's suggestion (use text field instead of lookup) should be the way.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to show a different column in a lookup field instead of the primary name column?

    Hello,

    Lookups were created to show the Primary Field value as a displayed value.

    If you want to have the requestor's email as a field on the form - create a text field instead of a lookup.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,488 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans