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!
Hello,
It should work fine. One thing to correct is getting the userid - docs.microsoft.com/.../usersettings
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?
This is perfect, thanks!
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) });
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
DAnny3211 136
Daniyal Khaleel 130
Abhilash Warrier 70 Super User 2025 Season 2