How to show data from inner SOQL Query in lightning component.

Lightning Component
Prerequisites : basic understanding of Lightning Component and apex programming

This sample code shows that how we can show data from inner SOQL query in lightning component.

In this sample code, we will fetch List of accounts with there related contacts and display it on lightning component by using aura:iteration. tag

apex class [accWithContController.apxc]

component [sample.cmp]

  • For display related contacts of account we are using nested aura:iteration.
  • In the nested aura:iteration we use list of contacts of a single account (which store in acc variable).

controller [sampleController.js]

output -:

Like our facebook page for new post updates.?

(Visited 5,089 times, 1 visits today)


  • This page has an error. You might just need to refresh it. Error in $A.getCallback() [repsonse is not defined] Callback failed: apex://test_acc_dev.AccountDetailController/ACTION$fetchAccount Failing descriptor: {markup://test_acc_dev:AccountDetails}

    Note:My Controller name is different here


    I’am getting this error.How should I resolve this ?

Leave a Reply