I need to display object label instead of API name in the combobox. How to access label of object dynamically? Below is the scrrenshot and code!
.JS
getCustomObjects({
})
.then(result => {
var i;
for (i = 0; i < result.length; i++) {
var item = {
label: result[i],
value: result[i]
};
this.customObjectOptions.push(item)
console.log('this.customObjectOptions : ' + JSON.stringify(this.customObjectOptions));
}
})
.catch(error => {
this.error = error;
console.log('error ===>: ' + error.body.message);
});
.html
<template if:true={showCustomComboBox}>
<lightning-combobox name="CustomObject" label="Select Custom Object:" aria-setsize="5"
options={customObjectOptions} onchange={handleChange}>
</lightning-combobox>
</template>