I have been practicing the examples given in Lightning developes Guide and the topic is Display Record Data in a Custom User Interface Using force:recordData

I copied and pasted the below code Loading a Record but no output is getting displayed.

<aura:attribute name="record" type="Object"/>
<aura:attribute name="simpleRecord" type="Object"/>
<aura:attribute name="recordError" type="String"/>

<force:recordData aura:id="recordLoader"

<!-- Display a lightning card with details about the record -->
<div class="Record Details"> 
<lightning:card iconName="standard:account" title="{!v.simpleRecord.Name}" >
    <div class="slds-p-horizontal--small">
        <p class="slds-text-heading--small">
            <lightning:formattedText title="Billing City" value="{!v.simpleRecord.BillingCity}" /></p>
        <p class="slds-text-heading--small">
            <lightning:formattedText title="Billing State" value="{!v.simpleRecord.BillingState}" /></p>

<!-- Display Lightning Data Service errors, if any -->
<aura:if isTrue="{!not(empty(v.recordError))}">
    <div class="recordError">

  • Please help me in this. Thanks in advance. Commented Oct 14, 2019 at 13:09

1 Answer 1


You need to specify the fields to load or the layout mode. Add the following to force:recordData:

  • Thanks for your prompt response. I tried adding the suggested field (layout="FULL") under force:recordData but it displayed the below error if am using layoutType="FULL" it again shows the same blank page as earlier. Commented Oct 15, 2019 at 4:59
  • Failed to save DisplayRecordExample.cmp: The attribute "layout" was not found on the COMPONENT markup://force:recordData: Source Commented Oct 15, 2019 at 4:59
  • @MAYANKSINGH Sorry, it should have been layoutType="FULL". I have updated the answer.
    – sfdcfox
    Commented Oct 15, 2019 at 10:25

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