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
Tulasiram ChippalaTulasiram Chippala 

Displaying no data available in Lightning Web Components

I am using the below code and placed that component in the Home page using app builder. But it is displaying No Data available.
    <template if:true={contact}>
        <lightning-layout vertical-align="center">
            <lightning-layout-item padding="around-small">
    <template if:false={contact}
        ><p>No contact data available.</p></template

js code:
import { LightningElement, api } from 'lwc';

export default class ContactTile extends LightningElement {
    @api contact;

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="">
<targetConfig targets="lightning__RecordPage">

Where i am doing a mistake.User-added image​​​​​​​
Raj VakatiRaj Vakati
try like this
import { LightningElement, api, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
import CONTACT_NAME_FIELD from '@salesforce/schema/Contact.Name';

export default class ContactTile extends LightningElement {
    @api recordId;
  @wire(getRecord, { recordId: '$recordId', fields: [CONTACT_NAME_FIELD] })
    <lightning-card title="Wire Function" icon-name="standard:contact">
        <template if:true={}>
            <div class="slds-m-around_medium">
		    <template if:false={}
No Data 

Khan AnasKhan Anas (Salesforce Developers) 
Hi Ram,

Greetings to you!

To get the data, you need to use the getRecord wire adapter. Please refer to the below links which might help you further with the above requirement.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
As suggest earlier you can use wire to call apex or can use LDS too.

    <lightning-card title="Record Edit Form Contact" icon-name="standard:contact">

        <div class="slds-m-around_medium">
                <lightning-input-field field-name="Name"></lightning-input-field>
                <lightning-input-field field-name="Title"></lightning-input-field>
                <lightning-input-field field-name="Phone"></lightning-input-field>
                <lightning-input-field field-name="Email"></lightning-input-field>
                <div class="slds-m-top_medium">
                    <lightning-button variant="brand" type="submit" name="save" label="Save"></lightning-button>



You can use lightning-record-form, lightning-record-edit-form, or lightning-record-view-form components.

You can check more details here.