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 :
Customer experience | Sales, Customer Insights,...
Answered

Currently logged in user's email address in model-driven app

(0) ShareShare
ReportReport
Posted on by 45

Is there a way to access the currently logged in user's email in a model-driven app? I can see ways to do it in a canvas app, and I can get the user's id and name using XRM in web resources, but so far I have yet to find a way to access the email address that way.

Thanks!

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can use following code to receive email of current user:

    Xrm.WebApi.retrieveRecord("systemuser", Xrm.Page.context.getUserId(), "?$select=internalemailaddress").then(
        function(t){
        console.log(t.internalemailaddress)
        });

  • chillzilla Profile Picture
    45 on at

    This is perfect, thanks!

  • BridgeInbetween Profile Picture
    10 on at

    Hi Andrew,

    I appreciate this is an older comment, will this work as a JS function inside a model driven app trying to use it as an OnLoad event?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    It should work fine. One thing to correct is getting the userid - docs.microsoft.com/.../usersettings

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans