I am using lightning-datatable to display a set of data. Now there are two fields that are formula fields. I am able to get the values of those fields from backend but not able to display them on Front end.
JS:
const columns = [
{
label: 'Rig Name',
fieldName: 'rigName',
type: 'text',
initialWidth: 130,
typeAttributes: { label: { fieldName: 'rigName' } },
sortable: true
},
{
label: 'Last RV Date',
fieldName: 'lastRVDate',
initialWidth: 100,
type: 'date-local',
typeAttributes: {
month: '2-digit',
day: '2-digit'
},
sortable: true
},
{
label: 'RV Scope',
fieldName: 'scope',
initialWidth: 100,
type: 'text',
typeAttributes: { label: { fieldName: 'scope' } },
sortable: true
},
{
label: ' RV No.',
fieldName: 'name',
initialWidth: 100,
type: 'url',
typeAttributes: { label: { fieldName: 'name' } },
sortable: true
},
{
label: 'Next RV Due Date (Min)',
fieldName: 'minRVDate',
type: 'text',
initialWidth: 200,
sortable: true
},
{
label: 'Next RV Due Date (Max)',
fieldName: 'maxRVDate',
type: 'text',
initialWidth: 200,
sortable: true
}
];
HTML
<div>
<lightning-datatable
key-field="id"
columns={columns}
data={activitiesList}
hide-checkbox-column>
</lightning-datatable>
Output:
{label: 'Next RV Due Date (Min)', fieldName: 'fooDate', type: 'date'}