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
Valentina 5Valentina 5 

Need urgent help Lightning datatable

Lightning datatable does not reflect Account.Name, Owner.Name, Created By. Name. what is the error?
doInit : function(component, event, helper) {
        component.set('v.mycolumns', [                 
            {label: 'Account Name', fieldName: 'Name', type: 'text',sortable: true},
            {label: 'Email', fieldName: 'Email', type: 'Email', sortable: true},
            {label: 'Contact Level', fieldName: 'Contact_Level__c', type: 'picklist',sortable: true},
            {label: 'Account', fieldName: 'Account.Name', type: 'text',sortable: true},
            {label: 'Owner', fieldName: 'Owner.Name', type: 'text',sortable: true},
            {label: 'Created By', fieldName: 'CreatedBy.Name', type: 'text', sortable: true},
            {label: 'Created Date', fieldName: 'CreatedDate', type: 'data',sortable: true},
            {label:'Action',type:  'button',typeAttributes:
             {iconName: 'utility:view',label: 'Del',name: 'Del', disabled: false,value: 'viewBtn'}
            }
        ]);
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi valentina,
we cannot access parent record data using dot notation directly.Data has to be flatten on client side or server side.
Please refer below link which might help you further
https://salesforce.stackexchange.com/questions/200761/parent-field-in-lightning-datatable

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards
Maharajan CMaharajan C
https://iwritecrappycode.wordpress.com/2017/11/22/salesforce-lightning-datatable-query-flattener/