I searched a couple of days ago how can I get the current user Id in Lightning Experience without using an Apex controller, and found that I can use the following:

var userId = $A.get('$SObjectType.CurrentUser.Id');

The problem is that I can't find what else I can get with $SObjectType. The documentation on Value Providers only show globalId, $Browser, $Label, $Locale and $Resource.


There is an open idea to get sObjectType to Lightning - https://success.salesforce.com/ideaView?id=0873A000000E4dRQAS.

Till that time the feature is implemented or documented, it may be safe to assume that it is not supported! What works may continue to work until it is broken.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.