I have a component with an attribute. I try to pass the value to the controller without succes. How do I achieve this.
Aura component
<aura:attribute name="currentUser" type="User"/>
<force:recordData aura:id="recordLoader" recordId="{!$SObjectType.CurrentUser.Id}" fields="Return_URL__c" targetFields="{!v.currentUser}"/>
{!v.currentUser.Return_URL__c}
Controller
let userCustomField = component.get("v.userRecord").Return_URL__c;
The field is rendering correctly in the component. What am I mising. Thanks in advance