function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kallam salesforce1kallam 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
<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] **
 
Best Answer chosen by kallam salesforce1
AshwiniAshwini (Salesforce Developers) 
Hi @kallam salesforce1,

The issue seems to be with <lightning-combobox> tag.

Try changining your HTML file as below:
<template>
    <lightning-card>
        <lightning-combobox
            label="Folders"
            value={value}
            options={folders}
            onchange={handleChange}
        >
        </lightning-combobox>
    </lightning-card>
</template>

Related:https://developer.salesforce.com/docs/component-library/bundle/lightning-combobox/example

If this information helps, please mark the answer as best. Thank you