<aura:attribute name="lookupcase" type="Case" default="{
'sobjectType': 'Case',
'ContactId': '{!v.userInfo.ContactId}',
'AccountId': '0012D000002oAkt'
}"/>
hi gaston, we can not set attribute default value as dynamic, you can achive this by set the attribute value by javaScript controller on component load for example : <aura:component>
<aura:handler name="init" value="this" action="{!c.doInit}"/>
<aura:attribute name="lookupcase" type="Case" default="{
'sobjectType': 'Case',
'ContactId': '',
'AccountId': '0012D000002oAkt'
}"/>
</aura:component>
javaScript controller :
i hope it helps you. Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others thanks http://sfdcmonkey.com (http://sfdcmonkey.com )({
doInit : function(component, event, helper) {
var action = component.get("c.fetchUser");
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var storeResponse = response.getReturnValue();
// set current user information on userInfo attribute
component.set("v.userInfo", storeResponse);
// @@@@@ set default value here @@@@
var getContactId = component.get("v.userInfo.ContactId");
component.set("v.lookupcase.ContactId" , getContactId ) ;
}
});
$A.enqueueAction(action);
}
})