+ Start a Discussion
Rama_SFDCRama_SFDC 

How to bind field api name in result in LWC

Hi All ,
How to bind field api name in result , i'm passing field api and  thorugh the design property and passing record  to server side controller . when i hardcoded in js it is working fine 

@api fieldnames ; // desing property passing field api name 
@api fields ;
connectedCallback(){
getFields({recordid: this.recordId })
.then(result => {
this.fields = result.Name;
this.error = undefined ;
});
}

Below code not working when binding the design propert in the result 

connectedCallback(){
getFields({recordid: this.recordId })
.then(result => {
this.fields = result.fieldnames ;
this.error = undefined ;
});
}

Thanks in Advance