You need to sign in to do that
Don't have an account?

Lightning Data Table Not pulling data
Hi,
Lightning data table not pulling the data. rows are comming as blank. I am trying to display the picklist values of Type field on the account. Code below:
HTML File:
<template>
<lightning-datatable
key-field="Id"
columns={columns}
data={picklistValues.data.values}>
</lightning-datatable>
</template>
JS File:
import {
LightningElement,
wire
} from 'lwc';
import {
getPicklistValues
} from 'lightning/uiObjectInfoApi';
import TYPE_FIELD from '@salesforce/schema/Account.Type';
export default class Picklistvalues extends LightningElement {
columns = [
{ label: 'Id', fieldName: 'Id', type: 'Id' },
{ label: 'Account Type', fieldName: TYPE_FIELD.fieldApiName, type: 'text' }
];
@wire(getPicklistValues, {
recordTypeId: '012o0000000qnHlAAI',
fieldApiName: TYPE_FIELD,
})
picklistValues;
}
Lightning data table not pulling the data. rows are comming as blank. I am trying to display the picklist values of Type field on the account. Code below:
HTML File:
<template>
<lightning-datatable
key-field="Id"
columns={columns}
data={picklistValues.data.values}>
</lightning-datatable>
</template>
JS File:
import {
LightningElement,
wire
} from 'lwc';
import {
getPicklistValues
} from 'lightning/uiObjectInfoApi';
import TYPE_FIELD from '@salesforce/schema/Account.Type';
export default class Picklistvalues extends LightningElement {
columns = [
{ label: 'Id', fieldName: 'Id', type: 'Id' },
{ label: 'Account Type', fieldName: TYPE_FIELD.fieldApiName, type: 'text' }
];
@wire(getPicklistValues, {
recordTypeId: '012o0000000qnHlAAI',
fieldApiName: TYPE_FIELD,
})
picklistValues;
}
first you need to check picklist values in js file:-