Get Current User Id in Lightning

Biswajeet   May 21, 2017   0 Comments

You need to call the $A.get("$SObjectType.CurrentUser.Id"), to get the User Id in the Lightning JS Controller.

1
2
var userId = $A.get("$SObjectType.CurrentUser.Id");
Console.log(userId);