You need to sign in to do that
Don't have an account?
kallam salesforce1
Values are not displaying in Combo box. I can able to get the data in @Wire method. I am not sure where is the issue?
HTML.File
I am getting data in Wire method as
**Get the Folder deatails@@@[{"Id":"00l5g000003cQw4AAE","Name":"EX","Type":"EmailTemplate"}] Get the folder values[object Object] **
<template> <lightning-card> <lightning-combobox> label="Folders" value={value} options={folders} onchange={handleChange} </lightning-combobox> </lightning-card> </template>
Js.File
import { LightningElement,wire,track } from 'lwc'; import getFolder from '@salesforce/apex/EmailTemplates.getFolder' export default class AddTempalte extends LightningElement { value = ''; @track folders = []; @wire (getFolder) wiredgetfolder({data, error}){ //console.log('Get the Folder deatails@@@'+JSON.stringify(data)) if(data){ console.log('Get the Folder deatails@@@'+JSON.stringify(data)) this.folders = data.map(a=>({ label : a.Name, value : a.Name })); console.log('Get the folder values &&&'+this.folders); } else if(error){ console.log('Get the error details are @@@'+error) } } handleChange(event){ console.log('Get the folder values'+this.folders); this.value = event.detail.value; } }
I am getting data in Wire method as
**Get the Folder deatails@@@[{"Id":"00l5g000003cQw4AAE","Name":"EX","Type":"EmailTemplate"}] Get the folder values[object Object] **
The issue seems to be with <lightning-combobox> tag.
Try changining your HTML file as below:
Related:https://developer.salesforce.com/docs/component-library/bundle/lightning-combobox/example
If this information helps, please mark the answer as best. Thank you