I need to get the Profile name in my Aura component. I am converting my JS button to a Lightning Quick Action, so I need something like this in my component:


3 Answers 3


You can't use $Profile in Lightning. For that, you need to write some Apex code. Please refer to this blog post for more details.

  • 5
    Can you include relevant code from the link in your answer or atleast how to retrieve profile id and name from apex
    – RedDevil
    Commented May 17, 2019 at 10:34

It's not necessary to make an Apex call for this. You can retrieve the profile of the current user with a force:recordData component and an associated aura:attribute component, like so:

<aura:attribute name="CurrentUser" type="Object"/>
<force:recordData recordId="{!$SObjectType.CurrentUser.Id}"

Then you can access that data in your component like so:


And in your component controller like so:

const username = component.get('v.CurrentUser')['Profile'].Name;
  • I tried this approach but it did not work for me. Do I need to populate anything for CurrentUser from the previous component/provide it as an input to this component?
    – SfdcBat
    Commented Feb 10, 2022 at 17:09
  • @SfdcBat, no, there's no prerequisite for this technique. At least there wasn't in my case.
    – isherwood
    Commented Sep 14, 2023 at 14:21

The global value providers you are used to using in Visualforce are not available in lightning. The Lightning Aura Components developer guide further expands on this and the supported global value providers.

So, you will have to get that info from the server in Apex using a callout from your quickactions component controller.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .