I want to get custom settings or custom metadata types in lightning web components for creating reusable component. Can anyone suggest me how to get custom metadata types or settings records using getRecord API of LWC.

1 Answer 1


You can define your template like below

    <lightning-card title="Sample custom Metadata" icon-name="standard:contact">
        <template if:true={metadataRecord.data}>
            <div class="slds-m-around_medium">

and in your js like this

import { LightningElement, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
const FIELDS = [

export default class CustomMetadataApp extends LightningElement {

    @wire(getRecord, { recordId: '$recordId', fields: FIELDS })
    get label() {
        return this.metadataRecord.data.fields.MasterLabel.value;

    get developername() {
        return this.metadataRecord.data.fields.DeveloperName.value;
  • how to get list type of custom metadata or settings? @Klecool Jun 24, 2020 at 12:56
  • I tried with above code snippet response is undefined @Klecool Jun 24, 2020 at 13:01
  • Unfortunately there is no way in LWC to get custom settings. you can also look at this link
    – Klecool
    Jun 24, 2020 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .